Skip to content

Stop duplicate validation errors in a struct if the struct itself has a validation tag

Compare
Choose a tag to compare
@petherin petherin released this 05 Feb 16:30
· 5 commits to master since this release
ddb45dd

Validation tags added to fields that are structs end up re-running validation for the struct's fields. This can lead to duplicated validation errors.

This change fixes that for validation tags added to fields that are structs, or pointers to structs. It does NOT address issues with fields that are maps or slices of structs.