-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: Add support for omitting empty and zero values in validation (including nil pointer and empty content of pointer) #1289
Conversation
dcb76a8
to
68a0594
Compare
Waiting for this to be merged |
@deankarn This PR's merge has been blocked, can you help take a look at the issue? |
@deankarn Do you know when this might be merged? |
Sorry @chrislentz been getting some more people to help maintain this package as my time is super limited. No reason I can see not to merge though. |
@deankarn If possible, I would like to become a maintainer of this package. |
…ncluding nil pointer and empty content of pointer) (go-playground#1289) ## Fixes Or Enhances **Add the `omitzero` Tag:** - It allows you to ignore the subsequent validations if the value of a field is empty - If the field is a pointer and the pointer is nil, ignore the subsequent validations - If the field is a pointer and the pointer is not nil, but the content value of the pointer is zero, the subsequent validations will be ignored **Make sure that you've checked the boxes below before you submit PR:** - [x] Tests exist or have been written that cover this particular change. @go-playground/validator-maintainers
Fixes Or Enhances
Add the
omitzero
Tag:Make sure that you've checked the boxes below before you submit PR:
@go-playground/validator-maintainers