fix(zod-openapi): remove the type error for the hook (#607)
* fix(zod-openapi): remove the type error for the hook * add changesetpull/608/head
parent
f05860486c
commit
375c98b145
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@hono/zod-openapi': patch
|
||||
---
|
||||
|
||||
fix: remove the type error for the hook
|
|
@ -322,7 +322,17 @@ export class OpenAPIHono<
|
|||
I,
|
||||
E,
|
||||
P,
|
||||
RouteConfigToTypedResponse<R> | Response | Promise<Response> | void | Promise<void>
|
||||
R extends {
|
||||
responses: {
|
||||
[statusCode: number]: {
|
||||
content: {
|
||||
[mediaType: string]: ZodMediaTypeObject
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
? MaybePromise<RouteConfigToTypedResponse<R>> | undefined
|
||||
: MaybePromise<RouteConfigToTypedResponse<R>> | MaybePromise<Response> | undefined
|
||||
>
|
||||
| undefined = this.defaultHook
|
||||
): OpenAPIHono<
|
||||
|
|
|
@ -1019,14 +1019,13 @@ describe('With hc', () => {
|
|||
},
|
||||
(result, c) => {
|
||||
if (!result.success) {
|
||||
const res = c.json(
|
||||
return c.json(
|
||||
{
|
||||
ok: false,
|
||||
source: 'routeHook' as const,
|
||||
},
|
||||
400
|
||||
)
|
||||
return res
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue