-
Notifications
You must be signed in to change notification settings - Fork 75
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
Array parameter in path #123
Comments
It seems that collectionFormat is not used even if present in the swagger def file. Not in query nor path parameters. In hapi-openapi/test/test-hapi-openapi.js, in query validation we have only multi collectionFormat
even if in the defs file, collectionFormat is defined to csv. We should have:
|
You might use Add tests to the PR and I will look at merging. |
Fixed. |
Hello,
I have a problem (bug?) with an array parameter in path.
My swagger spec file looks like:
If I make a request to this url;
http://localhost:3000/foo/white
Everything is all right.
But if I request:
http://localhost:3000/foo/white,black
I have a 400 bad request, invalid request params input.
If I add
collectionFormat: csv
, it changes nothing. And it seems that it is not take into account because if I addcollectionFormat: ssv
, swagger ui continue to generate the same url with comas!Furthermore, if I remove the enum line, so my items are only of type string and do the following request:
http://localhost:3000/foo/white,black
In my handlers, if I display
request.params
, I obtain:{bar: [ 'white,black' ] }
Instead of:
{bar: ['white', 'black'] }
Could you help me to find the solution?
Thank you
Ref: https://swagger.io/docs/specification/2-0/describing-parameters/#path-parameters
The text was updated successfully, but these errors were encountered: