Middleware that validates a request's route params, query and/or body with
Zod. On failure it answers status (400) with the failed fields in
details, by the response contract; malformed JSON is a 400 and a body
that is neither JSON nor a form a 415. On success the handler reads the
parsed data, typed, from c.get("validated"):
Middleware that validates a request's route params, query and/or body with Zod. On failure it answers
status(400) with the failed fields indetails, by the response contract; malformed JSON is a 400 and a body that is neither JSON nor a form a 415. On success the handler reads the parsed data, typed, fromc.get("validated"):A query field declared as an array takes every value of a repeated parameter (
?id=1&id=2); the others take the first.