Open
Description
When array_use_braces
is set to true
, array parameters are omitted when they are body parameters but don't explicitly specify documentation: { param_type: "body" }
.
Example:
# with add_swagger_documentation(array_use_braces: true)
params do
requires :param1, type: Array[String]
requires :param2, type: Array[Integer], documentation: { param_type: "body" }
end
post :foo do
{ declared_params: declared(params)
end
The spec will look like:
"postFoo": {
"required": ["param2"],
"type": "object",
"properties": {
"param2": {
"type": "array",
"items": { "type": "integer", "format": "int32" }
}
}
}
It is particularly annoying if one wants to share some params between GET and POST/PUT/PATCH endpoints and rely on the implicit behavior to have the params be query params or body params as appropriate.
Metadata
Metadata
Assignees
Labels
No labels