go-playground / validator

:100:Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving
MIT License
16.79k stars 1.32k forks source link

Fix validator `excluded_unless` #1064

Closed jenoudet closed 1 year ago

jenoudet commented 1 year ago

Fixes Or Enhances

Fixes #1063

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

@go-playground/validator-maintainers @deankarn

coveralls commented 1 year ago

Coverage Status

Coverage: 74.191%. Remained the same when pulling 43feaa366fe32dda3690e4fdc4e1425f084f1657 on jenoudet:fix-excluded_unless into 8f07b0368280d9fc70b4ffd3708b31427bbc286d on go-playground:master.

smares commented 1 year ago

Isn't this the same as https://github.com/go-playground/validator/pull/939?

jenoudet commented 1 year ago

@smares No, #939 fixes exluded_if (do nothing, except if all conditions have been met, then exclude the field) , this PR fixes excluded_unless (exclude the field, except if all conditions have been met, then do nothing). They serve different purposes.