feat(zod-openapi): add target property to parameter of validation hook (#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>pull/761/head
parent
09bb26fccf
commit
f6d642afdd
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@hono/zod-openapi': patch
|
||||
---
|
||||
|
||||
fix: add target property to parameter of validation hook
|
|
@ -185,7 +185,7 @@ 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
|
||||
|
@ -193,7 +193,8 @@ export type Hook<T, E extends Env, P extends string, R> = (
|
|||
| {
|
||||
success: false
|
||||
error: ZodError
|
||||
},
|
||||
}
|
||||
),
|
||||
c: Context<E, P>
|
||||
) => R
|
||||
|
||||
|
|
Loading…
Reference in New Issue