Skip to content

Commit

Permalink
feat(zod-openapi): add target property to parameter of validation hook (
Browse files Browse the repository at this point in the history
#756)

* feat(zod-openapi): add target property to parameter of validation hook

Signed-off-by: Luca Schultz <github@lucaschultz.com>

* add changeset

---------

Signed-off-by: Luca Schultz <github@lucaschultz.com>
Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
  • Loading branch information
lucaschultz and yusukebe authored Oct 3, 2024
1 parent 09bb26f commit f6d642a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/purple-lizards-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hono/zod-openapi': patch
---

fix: add target property to parameter of validation hook
5 changes: 3 additions & 2 deletions packages/zod-openapi/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,16 @@ export type RouteConfigToTypedResponse<R extends RouteConfig> = {
}[keyof R['responses'] & RouteConfigStatusCode]

export type Hook<T, E extends Env, P extends string, R> = (
result:
result: { target: keyof ValidationTargets } & (
| {
success: true
data: T
}
| {
success: false
error: ZodError
},
}
),
c: Context<E, P>
) => R

Expand Down

0 comments on commit f6d642a

Please sign in to comment.