-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request - To get the field name from the incoming request #52
Labels
enhancement
New feature or request
Comments
OK. |
Is there progress in this direction? Since it is impossible to directly obtain the field name, you have to use regular expressions. Example: func errorFormat(errMsg error) error {
reg, err := regexp.Compile(`Reason: (.*), Location: (.*)`)
if err != nil {
return err
}
match := reg.FindStringSubmatch(errMsg.Error())
if len(match) > 2 {
return fmt.Errorf("%s: %s", match[2], match[1])
}
return errMsg
} Which is not entirely convenient and instead of the field name you get something like this: /properties/password/minLength |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I would like to ask, if you can add a feature where in Request/Response Validation Errors we can get the "field" name . This is also provided in Kin api but not in this API.
I think this would be great addittion to this great API
The text was updated successfully, but these errors were encountered: