Skip to content
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

Non required parameters with empty values are not caught #389

Closed
nmeheus opened this issue Jul 29, 2021 · 1 comment · Fixed by #515
Closed

Non required parameters with empty values are not caught #389

nmeheus opened this issue Jul 29, 2021 · 1 comment · Fixed by #515

Comments

@nmeheus
Copy link

nmeheus commented Jul 29, 2021

According to the specifications an empty valued parameter is not equal to the parameter not being present. For required parameters one can use the allowEmptyValue: true/false to (dis)allow ?queryparam=, but for non required query parameters there seems no way to prevent ?queryparam= and ?queryparam(*) from passing the validation.

A small snippet to illustrate the expected behaviour, and how it fails with the current implementation: https://goplay.space/#T58uhnOPA-t

(*) Note that this behaviour (without the =) is also not working as expected for required parameters.

@fenollp
Copy link
Collaborator

fenollp commented Jul 29, 2021

Thanks for the demo code! Amazing!

So yes there is no handling of allowEmptyValue appart from un/marshaling. PRs very welcomed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants