Reputation: 163538
When documenting an API, is there a way to provide a list of possible values? Something like this:
{
"name": "propertyType",
"in": "query",
"description": "Type of home",
"required": false,
"type": "list",
"listValues": ["singleFamilyHome", "condo", "farm", …]
}
Upvotes: 5
Views: 9979
Reputation: 2257
In swagger 2.0 you can use enum:
{
"name": "propertyType",
"in": "query",
"description": "Type of home",
"required": false,
"type": "list",
"enum": ["singleFamilyHome", "condo", "farm"]
}
You ca find more info here: How to define enum in swagger.io?
Upvotes: 8