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]
|
}[keyof R['responses'] & RouteConfigStatusCode]
|
||||||
|
|
||||||
export type Hook<T, E extends Env, P extends string, R> = (
|
export type Hook<T, E extends Env, P extends string, R> = (
|
||||||
result:
|
result: { target: keyof ValidationTargets } & (
|
||||||
| {
|
| {
|
||||||
success: true
|
success: true
|
||||||
data: T
|
data: T
|
||||||
|
@ -193,7 +193,8 @@ export type Hook<T, E extends Env, P extends string, R> = (
|
||||||
| {
|
| {
|
||||||
success: false
|
success: false
|
||||||
error: ZodError
|
error: ZodError
|
||||||
},
|
}
|
||||||
|
),
|
||||||
c: Context<E, P>
|
c: Context<E, P>
|
||||||
) => R
|
) => R
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue