/Knowledge/sources/honojs__hono/llms-full/validation-with-zod--part-02--86ea630f3769.md
Validation: With Zod (part 02) - hono-docs
Validation: With Zod (part 02) Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt with zod Summary ts con...
Validation: With Zod (part 02)
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#with-zod
Summary
## Content
```ts
const route = app.post(
'/posts',
validator('form', (value, c) => {
const parsed = schema.safeParse(value)
if (!parsed.success) {
return c.text('Invalid!', 401)
}
return parsed.data
}),
(c) => {
const { body } = c.req.valid('form')
// ... do something
return c.json(
{
message: 'Created!',
},
201
)
}
)
Metadata
{
"chunk_index": 1,
"citation": "https://hono.dev/llms-full.txt#with-zod",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Validation > With Zod (2)",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 103,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "Validation: With Zod (part 02)",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}