What is the equivalent of anyof in Swagger version 2.0, Please tell me how to update my json file because I want to upgrade my documentation from swagger 1.0 to 2.0.
Thank You for your Help.
What is the equivalent of anyof in Swagger version 2.0, Please tell me how to update my json file because I want to upgrade my documentation from swagger 1.0 to 2.0.
Thank You for your Help.
anyOf
andoneOf
are now supported in OpenAPI Specification 3.0 (released on July 26, 2017).I don't think there is one and it feels like a big shortcoming. It's definitely not mentioned in the Schema Object portion of the specification. They call out the elements there that have been adopted from the JSON Schema and
anyOf
isn't among them:I think the closest thing is the
discriminator
field, but that means you've got to structure your output to accommodate Swagger.