fix(zod-openapi): relax input types (#211)
* fix(zod-openapi): relax input types * changesetpull/212/head
parent
cb5bba456b
commit
6ca8e8d8de
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@hono/zod-openapi': patch
|
||||
---
|
||||
|
||||
fix: relax input types
|
|
@ -63,7 +63,7 @@ type InputTypeBase<
|
|||
> = R['request'] extends RequestTypes
|
||||
? RequestPart<R, Part> extends AnyZodObject
|
||||
? {
|
||||
in: { [K in Type]: z.input<RequestPart<R, Part>> }
|
||||
in: { [K in Type]: z.infer<RequestPart<R, Part>> }
|
||||
out: { [K in Type]: z.output<RequestPart<R, Part>> }
|
||||
}
|
||||
: {}
|
||||
|
@ -77,7 +77,7 @@ type InputTypeJson<R extends RouteConfig> = R['request'] extends RequestTypes
|
|||
: R['request']['body']['content'][keyof R['request']['body']['content']]['schema'] extends ZodSchema<any>
|
||||
? {
|
||||
in: {
|
||||
json: z.input<
|
||||
json: z.infer<
|
||||
R['request']['body']['content'][keyof R['request']['body']['content']]['schema']
|
||||
>
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ type InputTypeForm<R extends RouteConfig> = R['request'] extends RequestTypes
|
|||
: R['request']['body']['content'][keyof R['request']['body']['content']]['schema'] extends ZodSchema<any>
|
||||
? {
|
||||
in: {
|
||||
form: z.input<
|
||||
form: z.infer<
|
||||
R['request']['body']['content'][keyof R['request']['body']['content']]['schema']
|
||||
>
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue