Ruby On Rails automatically parses query params as array if they are given in format expand[]
.
Like so
def update
expand_array = params[:expand]
end
But how can we write a Swagger(or OpenAPI) documentation for that param?
In this way:
- name: expand[]
in: query
type: array
items:
type: string # our items type
collectionFormat: multi
collectionFormat: multi
is needed so param can exist in a query multiple times, like expand[]=one&expand[]=two
, and brackets can be added just to the param name.
Top comments (0)