asaskevich / govalidator

[Go] Package of validators and sanitizers for strings, numerics, slices and structs
MIT License
6k stars 556 forks source link

Fix for error message getting name of the parent json tag instead of the field tag when parent json tag is available. #438

Open ghost opened 3 years ago

ghost commented 3 years ago

Fixes #351 Summary With the current behavior, if a field of the struct is having any validation error, the error message contains the struct JSON tag name instead of the field name. With this fix, the error message will have the field name instead of the struct JSON name.

ghost commented 3 years ago

@asaskevich Please review.

sergeyglazyrindev commented 2 years ago

Hello guys! I forked this package cause owner disappeared. Hope, he will be back, but it would be easier to merge these changes back if he is back Link to my repo: create issue there and we'll discuss it.