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

explicitly check for empty values when allowEmptyValues is false #62

Closed
karenetheridge opened this issue Sep 24, 2023 · 2 comments
Closed
Labels
blocked blocked on something else wontfix This will not be worked on

Comments

@karenetheridge
Copy link
Owner

karenetheridge commented Sep 24, 2023

Mojo param parsing behaves as if allowEmptyValue is true, which is not the openapi default:

for my $pair (split /&/, $str) {
  next unless $pair =~ /^([^=]+)(?:=(.*))?$/;
  my ($name, $value) = ($1, $2 // '');
...

If we want to verify that empty values aren't passed, then we need to parse the parameters ourselves and error when $2 is undef.

@karenetheridge
Copy link
Owner Author

Just as in #63, this is difficult to do without having access to the original request (Mojo::Parameters::pairs turns a missing query value into '').

@karenetheridge karenetheridge added wontfix This will not be worked on blocked blocked on something else labels Sep 25, 2023
@karenetheridge
Copy link
Owner Author

allowEmptyValue recently saw some clarification in the spec: OAI/OpenAPI-Specification#3835

..which is reflected here via commit 061d164, which was released in v0.065.

@karenetheridge karenetheridge closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked blocked on something else wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant