I'm working with Swagger Editor to create an API, and in implementing a search endpoint, I am trying to do something like this:
/pets:
get:
summary: Retrieve a list of pets
description: Retrieve a list of pets based on search parameters
parameters:
- name: countryCode
in: query
description: The ISO 2-digit country code.
required: false
type: string
- name: subdivisionCode
in: query
description: The ISO subdivision code.
required: false
type: string
I ONLY want subdivisionCode to be required if countryCode is included, otherwise they are both optional.
Is there a way to accomplish this in Swagger?
Thanks!