/Knowledge/sources/honojs__hono/llms-full/validation-with-zod--0328d6373961.md
Validation: With Zod - hono-docs
Validation: With Zod Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt with zod Summary You can use Zod,...
Validation: With Zod
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#with-zod
Summary
You can use Zod, one of third-party validators. We recommend using a third-party validator. Install from the Npm registry. ::: code-group sh [npm] npm i zod sh [yarn] yarn add zod ```sh [pnpm] pnpm add zo...
Content
You can use Zod, one of third-party validators. We recommend using a third-party validator.
Install from the Npm registry.
::: code-group
npm i zod
yarn add zod
pnpm add zod
bun add zod
:::
Import z from zod.
import * as z from 'zod'
Write your schema.
const schema = z.object({
body: z.string(),
})
You can use the schema in the callback function for validation and return the validated value.
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#with-zod",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Validation > With Zod (1)",
"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",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}