The request's body parsed by schema, typed; throws a ValidationError (400, with the failed fields in details) when it does not match. JSON by default; see BindOptions for forms and case-insensitive keys.
schema
ValidationError
details
BindOptions
app.post('/users', async (c) => { const user = await bindBody(c, z.object({ nombre: z.string() }), { caseInsensitiveKeys: true }); return ok(c, await users.create(user), { status: 201 });}); Copy
app.post('/users', async (c) => { const user = await bindBody(c, z.object({ nombre: z.string() }), { caseInsensitiveKeys: true }); return ok(c, await users.create(user), { status: 201 });});
The request's body parsed by
schema, typed; throws aValidationError(400, with the failed fields indetails) when it does not match. JSON by default; seeBindOptionsfor forms and case-insensitive keys.