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

validateIntParameter/validateLongParameter in KiwiResources should throw IllegalArgumentException given null params #666

Closed
sleberknight opened this issue Feb 1, 2022 · 0 comments · Fixed by #667
Assignees
Labels
enhancement A request for change or improvement to an existing feature
Milestone

Comments

@sleberknight
Copy link
Member

Currently validateIntParameter and validateLongParameter in KiwiResources throw a JaxrsBadRequestException if they are given a null parameter map. This really is not correct, since these methods are designed to check a given non-null map containing request/query parameters. Instead, if given a null parameter map, these methods should throw IllegalArgumentException.

JAX-RS methods that return a MultivaluedMap containing request/response headers or containing request query parameters do not return null values, therefore we should assume that is the case and consider a null to be an illegal argument,

@sleberknight sleberknight added the enhancement A request for change or improvement to an existing feature label Feb 1, 2022
@sleberknight sleberknight added this to the 1.3.0 milestone Feb 1, 2022
@sleberknight sleberknight self-assigned this Feb 1, 2022
sleberknight added a commit that referenced this issue Feb 1, 2022
* Add validateOneIntParameter
* Add validateExactlyOneIntParameter
* Add validateOneOrMoreIntParameters
* Add validateOneLongParameter
* Add validateExactlyOneLongParameter
* Add validateOneOrMoreLongParameters
* Modify existing validateIntParameter and validateLongParameter to
  throw IllegalArgumentException if given a null parameter map (#666)

Closes #604
Closes #666
chrisrohr pushed a commit that referenced this issue Feb 2, 2022
* Add validateOneIntParameter
* Add validateExactlyOneIntParameter
* Add validateOneOrMoreIntParameters
* Add validateOneLongParameter
* Add validateExactlyOneLongParameter
* Add validateOneOrMoreLongParameters
* Modify existing validateIntParameter and validateLongParameter to
  throw IllegalArgumentException if given a null parameter map (#666)

Closes #604
Closes #666
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A request for change or improvement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant