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,
|
I,
|
||||||
E,
|
E,
|
||||||
P,
|
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
|
| undefined = this.defaultHook
|
||||||
): OpenAPIHono<
|
): OpenAPIHono<
|
||||||
|
|
|
@ -1019,14 +1019,13 @@ describe('With hc', () => {
|
||||||
},
|
},
|
||||||
(result, c) => {
|
(result, c) => {
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
const res = c.json(
|
return c.json(
|
||||||
{
|
{
|
||||||
ok: false,
|
ok: false,
|
||||||
source: 'routeHook' as const,
|
source: 'routeHook' as const,
|
||||||
},
|
},
|
||||||
400
|
400
|
||||||
)
|
)
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue