@hono/zod-validator
0.9.1 · 31 Aug 2026MIT8.5M / weekRepositorynpmAtom feed
0.9.1 is the newest release of 0.8.x.
In short
1 fixed
Release note
Minor Changes
zod-validator: Surface the default
400failure response so it propagates to the RPC schema (refs honojs/hono#3746).Widen the no-hook overload return type to
MiddlewareHandler<E, P, V, TypedResponse<ZodValidatorFailureBody<T>, 400, 'json'>>, so the defaultc.json(result, 400)body reachesMergeMiddlewareResponse<M_k>on the Hono side and shows up inhc<typeof app>as a typed400branch.Intersect the inferred middleware response with
Response(Response & TypedResponse<...>) in bothZodValidatorFailureResponse<T>andExtractValidationResponse<VF>so azValidator(...)middleware remains assignable to a plainMiddlewareHandler(avoids aTS2322regression caused by bareTypedResponse).Collapse the no-hook overload to also accept
undefinedfor the hook parameter together with theoptions.validationFunction, allowingzValidator(target, schema, undefined, { validationFunction })to match the typed-failure path.Bump
peerDependencies.honoto>=4.10.0because this PR now relies on the 4-argumentMiddlewareHandler<E, P, I, R>signature introduced in Hono v4.10.0; onhono<4.10.0,MiddlewareHandleronly accepts 3 type arguments and consumers would hitTS2707even though peer ranges currently allow it.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.