Skip to content

How to get a JSON name of a field? #1204

Closed Answered by deankarn
alekangelov asked this question in Q&A
Discussion options

You must be logged in to vote

The document does not say it will return the JSON name of the field, it is used as an example only and clearly states it will use the field(structs) field name unless overridden with the tag name function see https://github.com/go-playground/validator/blob/master/errors.go#L118

It is working as intended.

I am assuming you are referring to the Go documentation.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@alekangelov
Comment options

Answer selected by alekangelov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants