-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add input validation #180
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No endpoints that take in the HTTP body, params, or query use any form of runtime validation.
as
is not good enough (frankly not good at all) in these scenarios because that only provides a static check and is never used during runtime when dealing with incoming requests. I would suggest using something likezod-express-middleware
withzod
to easily couple an input schema for each route that needs it. Resulting malformed requests then will return back a 400 status code instead of 500.Example:
The text was updated successfully, but these errors were encountered: