Add request/response validation #21

Merged
antman merged 10 commits from add-request-validation into main 2026-08-25 06:42:58 +00:00
Owner

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

### 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
Add failing test
Some checks failed
/ test-and-lint (push) Failing after 2m53s
61960f9649
add validation
Some checks failed
/ test-and-lint (push) Has been cancelled
b5cb772122
weeeeeeee
Some checks failed
/ test-and-lint (push) Failing after 5m29s
8f0feb568f
change validator
Some checks failed
/ test-and-lint (push) Failing after 2m56s
467df65fa7
huhhh
Some checks failed
/ test-and-lint (push) Has been cancelled
78bf5652d0
derp
Some checks failed
/ test-and-lint (push) Failing after 2m48s
595b048acb
fffffffff
Some checks failed
/ test-and-lint (push) Has been cancelled
d45ada6451
try zValidator
Some checks failed
/ test-and-lint (push) Failing after 3m15s
167139f070
stick with standard validator
Some checks failed
/ test-and-lint (push) Failing after 3m2s
dc4064fcc6
make test good
All checks were successful
/ test-and-lint (push) Successful in 2m51s
b78470925d
antman changed title from WIP: Add request/response validation to Add request/response validation 2026-08-25 06:42:44 +00:00
antman merged commit 085857dc3b into main 2026-08-25 06:42:58 +00:00
antman deleted branch add-request-validation 2026-08-25 06:42:58 +00:00
antman referenced this pull request from a commit 2026-08-25 06:42:58 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kill-the-cloud/server-manager!21
No description provided.