diff --git a/.changeset/red-colts-retire.md b/.changeset/red-colts-retire.md new file mode 100644 index 00000000..02fef10d --- /dev/null +++ b/.changeset/red-colts-retire.md @@ -0,0 +1,5 @@ +--- +'@hono/zod-openapi': patch +--- + +Add Promise to Hook diff --git a/packages/zod-openapi/src/index.ts b/packages/zod-openapi/src/index.ts index 76ddbf30..c68dbbfa 100644 --- a/packages/zod-openapi/src/index.ts +++ b/packages/zod-openapi/src/index.ts @@ -155,7 +155,13 @@ export type Hook = ( error: ZodError }, c: Context -) => TypedResponse | Promise> | Response | Promise | void +) => + | TypedResponse + | Promise> + | Response + | Promise + | void + | Promise type ConvertPathType = T extends `${infer Start}/{${infer Param}}${infer Rest}` ? `${Start}/:${Param}${ConvertPathType}`