gary002g
4 years agoNew Contributor
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.