Skip to content

Returning a 400 error for invalid input #787

Answered by RobinTail
TheWisestOne asked this question in Q&A
Discussion options

You must be logged in to vote

@TheWisestOne ,

thank you so much for your patience and all the efforts you made regarding this problem.
The solution is about to be released in version 9.0.0-beta2 along with another potentially breaking change.

For the consistency I decided to create InputValidationError class, that you can utilize in custom ResultHandler for responding with 400. There is also a couple of error handling methods exposed. If you're using the default ResultHandler, no changes needed.

So, this should enable you using zod for database validations.

Consider checking the new version. Please let me know how it works.

Replies: 5 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@RobinTail
Comment options

@TheWisestOne
Comment options

Comment options

You must be logged in to vote
3 replies
@RobinTail
Comment options

@TheWisestOne
Comment options

@TheWisestOne
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by RobinTail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
breaking Backward incompatible changes
2 participants