/Wiki/sources/honojs__hono/2026/https-raw-githubusercontent-com-honojs-hono-main-b76d7e3301c3-current-validator-middleware-is-deprecated-s0015-c0000.md
Current Validator Middleware is deprecated - hono-docs
Current Validator Middleware is deprecated Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://raw.githubusercontent.com/hon...
Current Validator Middleware is deprecated
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://raw.githubusercontent.com/honojs/hono/main/docs/MIGRATION.md#current-validator-middleware-is-deprecated
Summary
At the next major version, Validator Middleware will be changed with "breaking changes". Therefore, the current Validator Middleware will be deprecated; please use 3rd-party Validator libraries such as Zod or [TypeBox]...
Content
At the next major version, Validator Middleware will be changed with "breaking changes". Therefore, the current Validator Middleware will be deprecated; please use 3rd-party Validator libraries such as Zod or TypeBox.
import * as z from 'zod'
//...
const schema = z.object({
title: z.string().max(100),
})
app.post('/posts', async (c) => {
const body = await c.req.parseBody()
const res = schema.safeParse(body)
if (!res.success) {
return c.text('Invalid!', 400)
}
return c.text('Valid!')
})