Open leighmcculloch opened 5 years ago
any updates ?
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.
The errors generated by the package include a field name and a path to the field that has failed validating, but they are inconsistent with what the contents of those fields are.
The path always contains the Go struct field names, where-as the field will contain the json tag name if a json tag was defined on that field.
For this reason it's hard to use the path when also using json tags, since they aren't both in the same format.
Example
If the email is set as
"gogopher@example-com"
, the following error will be outputted:https://play.golang.org/p/M3ZpBZwwNTy
The
Path
isDetails
which is the Go struct field name, not the json tag name, and theName
isemail
which is the json tag name.