diff --git a/packages/zod-openapi/src/index.ts b/packages/zod-openapi/src/index.ts index b1360a57..4287e8e7 100644 --- a/packages/zod-openapi/src/index.ts +++ b/packages/zod-openapi/src/index.ts @@ -185,7 +185,7 @@ export type RouteConfigToTypedResponse = { }[keyof R['responses'] & RouteConfigStatusCode] export type Hook = ( - result: + result: { target: keyof ValidationTargets } & ( | { success: true data: T @@ -193,7 +193,8 @@ export type Hook = ( | { success: false error: ZodError - }, + } + ), c: Context ) => R