-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No support for explode field in array query parameters #253
Comments
When it has no |
I'm facing this same issue while trying to validate inputs for an array but it's not working and I'm getting following error:
@shike99 did you fix this one or using any other alternative for this one? |
@mnj93 swagger.yml
Rails applicationFor example, in a controller:
|
@shike99 |
Hi. Imagine committee would support this and that you would have an optional "list" query parameter of type array in your API description and you get a request like |
I found out how to interpret it ( When we use query, Since we know this value's type is (And we should fix other library to resolve this issue so I created new issue ota42y/openapi_parser#122 ) |
Here is an issue that is probably related to this: #369 |
This dirty patch helps me to find missing required param with '[]' in name. Maybe this transofrmation should be placed in separate method. Not sure. class OpenAPIParser::ParameterValidator
class << self
private
def convert_key(k, is_header)
is_header ? k&.downcase : k.sub(/\[\]$/, '')
end
end
end |
This and all variants of About the "empty array case" with |
I just added a PR to openapi_parser to incorporate a similar fix as the Monkeypatch @pechorin provided above (which is working great for us as well currently) - hopefully we can get that functionality merged upstream since the validation here just proxies over to openapi_parser for parameter checking. |
For example, an optional query parameter of a string value, allowing multiple values by repeating the query parameter:
so this will be interpreted as
/path?id=1,2,3
, but the committee middleware will give a 400 response with this body:"{\"type\":\"bad_request\",\"message\":\"#/paths/~1path/get/parameters/2/schema expected array, but received String: 635\"}"
This is the specification of OpenAPI.
https://swagger.io/docs/specification/serialization/#query
https://spec.openapis.org/oas/v3.0.2#fixed-fields-9
The text was updated successfully, but these errors were encountered: