How to specify a property as null or a reference? discusses how to specify a property as null or a reference using jsonschema.
I\'m looking to do the same thing with
Not easy to do that. Even almost impossible. Your options :
There is a very long discussion about this point, maybe one day it will be done...
You can use vendors extensions like x-oneOf and x-anyOf. I have already taken this hard way: You must to upgrade all used 'swagger tools' to take into account these vendors extensions.
In my case, we needed 'only' to :
It was a year ago, maybe now ...
Many projects don't need anyOf and oneOf, why not us ?