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: Hexadecimal validation in v10 validator #989

Closed
wants to merge 1 commit into from

Conversation

V-R-Dighe
Copy link
Contributor

Fixes Or Enhances

Resolves #974

Make sure that you've checked the boxes below before you submit PR:

  • Tests exist or have been written that cover this particular change.

@go-playground/validator-maintainers

@V-R-Dighe V-R-Dighe requested a review from a team as a code owner August 19, 2022 14:33
@coveralls
Copy link

Coverage Status

Coverage remained the same at 74.177% when pulling 5405fa3 on V-R-Dighe:develop_final into 9e2ea40 on go-playground:master.

@deankarn
Copy link
Contributor

This change appears to allow a blank string to pass as a valid hexidecimal value which is not correct.
The referenced issue shows that omitempty or the required tags are what you want preceeding this validation.

@V-R-Dighe
Copy link
Contributor Author

This change appears to allow a blank string to pass as a valid hexidecimal value which is not correct. The referenced issue shows that omitempty or the required tags are what you want preceeding this validation.

Ok @deankarn , thanks for the reply.
Similar behaviour is there in most of the string tags. Do we always need to use an omitempty tag with them if the field is optional?
More simply, is the fix required for the issue?

@deankarn
Copy link
Contributor

Hey @V-R-Dighe no a fix is not needed for that issue.

Yes an omitempty tag should be used for optional values when at least one other validation exists.

@V-R-Dighe V-R-Dighe closed this Sep 13, 2022
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.

hexadecimal validation in v10 validator
3 participants