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

Fix: boolean casting #195

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

haddowg
Copy link

@haddowg haddowg commented Jun 3, 2024

This PR fixes two issues related to request validation.

  • If a parameter is not null but "falsey" such as 0 the parameter it is not validated
    this PR corrects this and updates the tests

  • It is currently not possible to validate "boolean" type parameters as the assertion will always fail since the string type value from the request parameter is not cast to boolean. The data (string) must match the type: boolean
    This PR casts true and false string values only to the appropriate boolean, and adds test coverage

fix: correctly validate "falsey" not null parameters values
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 this pull request may close these issues.

1 participant