Return field name in errors #999
mojixcoder
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As you might know, so many people are using this package for validating http requests.
Error handling is kinda tricky in this case. For example we have a field called
first_name
but in the error message we can't access this and we getFirstName
(golang struct field name).Can we add one more tag to get the name that we want instead of golang struct filed name?
Here is an example:
And in error handling:
It's not really nice to get
first_name
in the request and returnFirstName
in the response error msg.I know it can be handled manually with a little bit extra work.
But can you please handle it in the package? because I think it's a common problem.
Beta Was this translation helpful? Give feedback.
All reactions