We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I realize the validation errors are coming from Schema, but is there any way to further customize or improve upon this?
Schema
const LoginBody = S.Struct({ name: S.String, password: S.String.pipe(S.minLength(5, { message: () => 'My custom message' })) })
Error message:
{ "error": "Request validation error", "location": "body", "message": "{ readonly name: string; readonly password: a string at least 5 character(s) long }\n└─ [\"password\"]\n └─ My custom message" }
Preferred:
{ "error": "Request validation error", "location": "body", "message": { "password": "My custom message" } }
The text was updated successfully, but these errors were encountered:
The logic that I want is mostly implemented In the react-hook-form/resolvers effect logic
One way to allow this is if ServerRequestParser could be a service that I could implement and then provide?
ServerRequestParser
Or perhaps better: an ErrorFormatter service or function?
Sorry, something went wrong.
The Schema error message is great for a programmer, but that's not a shippable error message for a public API
I used to have a pluggable schema error formatter in the past but I got rid of it. I'll take a look and possibly reintroduce it.
No branches or pull requests
I realize the validation errors are coming from
Schema
, but is there any way to further customize or improve upon this?Error message:
Preferred:
The text was updated successfully, but these errors were encountered: