Add request/response validation #21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "add-request-validation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
Currently, clients can send JSON requests with an invalid schema and the server will try to process it until it runs into an exception. We want invalid requests to fail within the translation layer without ever leading to invocation of a controller.
The approach used in this PR will be replicated in the upcoming API server
Solution
Initially planned to use @hono/zod-validator but wound up choosing @hono/standard-validator because the functionality was almost identical except the zod validator returned the zod error object as a string containing JSON 🤦
This doesn't provide response validation, but… close enough for jazz
WIP: Add request/response validationto Add request/response validation