Reputation: 69
I have been wrecking my brain reading docs and trying to successfully pass through a list or an array of integers using swagger because I am trying to test my API.
I am trying to pass through a list of teamIDs like this: (I've been trying all kinds of variations, mind you) but the values are still not pulling through when I debug
{
"type": "array",
"items": {
"type": "integer",
"enum": [
1,
2,
3
]
}
I am using "enum" because its a list of values I am trying to pass through.
Here is a screenshot of my swagger method as well:
Upvotes: 2
Views: 3582
Reputation: 97991
A query parameter that is an array of integers is defined as follows:
{
"in: query",
"name": "teamIDs",
"type": "array",
"items": {
"type": "integer"
}
}
In your Swagger UI, enter the values for the teamIDs
parameter one per line, like so:
1
2
3
Upvotes: 1