ContributionsMost RecentMost LikesSolutionsRe: Defining conditional attributes in OpenAPI I have seen in the spec that OpenAPI does support oneOf and anyOf. However, I need something similar to the following construct that exists in JSON schema: "dependencies": { "postalCode": ["countryCode"], "longitude": ["latitude"], "latitude": ["longitude"] }, "anyOf": [ { "required": ["longitude", "latitude"] }, { "required": ["postalCode"] }, { "required": ["city", "state", "countryCode"] } ] I haven't seen these dependencies in the spec. I tried to do this: "required": [ "distance", "distanceUnits", "anyOf": [ {"longitude", "latitude"}, {"postalCode", "countryCode"}, {"city", "state", "countryCode"} ] ] but swagger editor gives me an error on anyOf construct. Defining conditional attributes in OpenAPI I need to define a request for a searching service in JSON. Request can have either geographical coordinates (longitude and latitude) or postal code. Either one must be present. If longitude is present, then latitude is required and vice versa. If both are omitted, postal code must be present. If geo coordinates present, postal code is optional (will be ignored if present). I am having trouble defining such request in swagger editor. If someone can help me, I will appreciate it greatly. We are using v.3.0.3 and the swagger file will be used to generate client code. Solved