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
Signed-off-by: Luca Schultz <[email protected]>
  • Loading branch information
lucaschultz committed Sep 30, 2024
1 parent 1ed5c7d commit 1e7163b
Showing 1 changed file with 3 additions and 2 deletions.
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 1e7163b

Please sign in to comment.