-
Notifications
You must be signed in to change notification settings - Fork 392
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
feat: add cast array to expected array query params #677
feat: add cast array to expected array query params #677
Conversation
f8c3d1f
to
7b23f13
Compare
7b23f13
to
0a96732
Compare
0a96732
to
d00d837
Compare
@NoNameProvided @nolazybits Is it possible to review this PR ? thanks, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me but that would be my first review here. I might have missed something. @NoNameProvided might want to double check + I don't think I have write access to this repo (required to have a valid approval) to it won't help unblock this MR
I found a bug on boolean management if only one is sent as query param, I'll complete the test with more boolean cases |
0e2f192
to
d4ba6bb
Compare
The bug is now fixed 😃 |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
Checklist
Update index.md
)develop
)npm run prettier:check
passesnpm run lint:check
passesFixes
Fixes #389, Fixes #320, Fixes #123
The idea is to parse query parameters as it is used to be. I added some exemple in the README, and in the tests :
You can use
isArray
option to get a query param array. This will cast the query param :GET /users/by-multiple-ids?ids=a
→ids = ['a']
GET /users/by-multiple-ids?ids=a&ids=b
→ids = ['a', 'b']
You can combine use
isArray
option withtype
option to get a query param array of one type. This will cast the query param :GET /users/by-multiple-ids?ids=1
→ids = [1]
GET /users/by-multiple-ids?ids=1&ids=3.5
→ids = [1, 3.5]
For QueryParams :