Closed ghost closed 5 years ago
The documentation for this was recently updated in this PR
https://godoc.org/gopkg.in/go-playground/validator.v9#Validate.RegisterTagNameFunc
after registering such a function then the json name will be used...it can also be customized any way you wish for BSON name, really anything.
let me know if that helps?
Package version eg. v8, v9:
v9
Issue, Question or Enhancement:
Question : I have struct Config which consist of Field SliceOfAnotherStruct which contained the slice of pointer to AnotherStruct. Now if validation failed for a field in AnotherStruct then validation error return me field name as Config.AnotherStruct[0].Bank Here how could I get the json tag for field Bank in AnotherStruct
Code sample, to showcase or reproduce: