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
Custom error param #1096
Comments
I'm not sure of why you would like to change the param name that failed. .withMessage({ reason: "name_esists", message: "name is duplicated" }) |
Hi, I know this doesn't good practice but you know that we could meet some projects that just need an array of errors key, such as mapping their i18n keys like: I have rewrite the result as my needs:
...but it's not good at all. Everything would be great if this provides a simple method to change it independently. |
My project needs to return a custom error format including the error param/key, so please consider to add this feature.
This new additional method could be
.withParam()
similar to the.withMessage()
Examples
this returns
{ "name" : "string only" }
Expected
this returns
{ "name_exists" : "string only" }
The text was updated successfully, but these errors were encountered: