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

Make docs for required more explicit regarding boolean values #1261

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

Conversation

alexongh
Copy link

required validates that the value is not the data types default zero value. For boolean the default zero value is false. Therefore, a false boolean value would be interpreted as not matching the required validation and fail.

This, in my opinion, is a little unexpected. Judging from the name required only, I expected that a false boolean value would be ok, since a value was provided.

Nevertheless, in my opinion, this behavior should be documented a little more explicitly. Which is why I propose this change to the docs.

  • Tests exist or have been written that cover this particular change.
    (this is only a docs change)

@go-playground/validator-maintainers

@alexongh alexongh requested a review from a team as a code owner May 11, 2024 16:33
@coveralls
Copy link

Coverage Status

coverage: 74.243%. remained the same
when pulling 043e9ee on alexongh:master
into e20b948 on go-playground:master.

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.

None yet

2 participants