I've seen a lot of talk on github issues regarding swagger's lack of support for oneOf and anyOf. Setting aside the merits of the arguments over there, I'm looking for a practical solution to the problem of a response object (or any object, really) that has a property that can be EITHER another object, or null. This is a real-world problem for my project: complex objects reference other objects, but in some cases, the referenced object is NULL, i.e, some parent objects do not point to a child and null is the appropriate value in these cases.
I'm surprised the spec doesn't handle this readily. There is x-nullable, provided by some consumers of the spec, but that does not work in conjunction with $ref, where the reference replaces the object wholesale, leaving the x-nullable setting ignored. I think I asked the question well over on stackoverflow, maybe someone here can earn some points over there: http://stackoverflow.com/questions/40920441/how-to-specify-a-property-can-be-null-or-a-reference-with-swagger -- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
