zero-rails_openapi
zero-rails_openapi copied to clipboard
Document parameter options outside of Schema object
Attempting to provide more specifications on the parameter object itself, such as style
or explode
seems impossible right now, as any options provided are nested under the schema
object itself.
Is there a way to achieve this? I feel like we would need an additional method parameter to capture this information separately from the schema options itself.
Proposed possibility:
api :index do
query! :'client_ids[]', Array[Integer], { uniqueItems: true }, style: :form, explode: true
end
Right now using 3 arguments and passing style: :form, explode: true
along with the uniqueItems: true
just results as those being nested incorrectly:
Generated, incorrect
{
"name": "client_ids[]",
"in": "query",
"required": true,
"schema": {
"type": "array",
"uniqueItems": true,
"explode": true,
"style": "form",
"items": {
"type": "integer"
}
}
}
Desired
{
"name": "client_ids[]",
"in": "query",
"required": true,
"explode": true,
"style": "form",
"schema": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "integer"
}
}
}
Some ideas of how to deal with that can be borrowed here.
I've updated my PR to include your case.