I have seen multiple ways to define arrays in query parameters in Swagger- and OpenAPI specifications. Are all the below examples valid? Are there more valid options?
Example 1:
...
{
"name": "example",
"in": "query",
"type": "array",
"items": {
"type": "string"
}
}
...
Example 2:
...
{
"name": "example",
"in": "query",
"type": "array",
"items": {
"properties": {
"username": {
"type": "string"
},
"password": {
"type": "string"
}
}
}
}
...
Example 3:
...
{
"name": "example",
"in": "query",
"type": "array",
"schema": {
"items": {
"type": "string"
}
}
}
...
Example 4:
...
{
"name": "example",
"in": "query",
"type": "array",
"schema": {
"items": {
"properties": {
"username": {
"type": "string"
},
"password": {
"type": "string",
}
}
}
}
}
...
Are there more options?
Thanks!