With ref. to this discussion https://groups.google.com/forum/#!topic/swagger-swaggersocket/5Oc9fQCPu5Q , i want to know the multi value select option (drop-down ) which was present in earlier version of swagger (1.2) is supported in 2.0 or not?
Just pushed a fix to address this. To show a single select input, your spec would look like such:
Note, the key here is to show the enum to tell the UI that they need to select from one of the values.
{
"name": "status",
"in": "query",
"default": "available",
"enum": [
"alive",
"dead",
"available"
],
"description": "Status values that need to be considered for filter",
"required": true,
"type": "string"
}
To show a multi-select input box:
{
"name": "tags",
"in": "query",
"description": "Tags to filter by",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"enum": [
"tag1", "tag2"
]
}
Note here, the input is an array, because it can have multiple input values. It will then format the input in accordance to the collectionFormat as defined here:
https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#parameter-object-
Most helpful comment
Just pushed a fix to address this. To show a single select input, your spec would look like such:
Note, the key here is to show the
enumto tell the UI that they need to select from one of the values.To show a multi-select input box:
Note here, the input is an array, because it can have multiple input values. It will then format the input in accordance to the
collectionFormatas defined here:https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#parameter-object-