diff --git a/.changeset/wild-poets-argue.md b/.changeset/wild-poets-argue.md new file mode 100644 index 00000000..23e07476 --- /dev/null +++ b/.changeset/wild-poets-argue.md @@ -0,0 +1,5 @@ +--- +'@hono/zod-openapi': patch +--- + +fix: relax input types diff --git a/packages/zod-openapi/src/index.ts b/packages/zod-openapi/src/index.ts index ce38933d..67be1364 100644 --- a/packages/zod-openapi/src/index.ts +++ b/packages/zod-openapi/src/index.ts @@ -63,7 +63,7 @@ type InputTypeBase< > = R['request'] extends RequestTypes ? RequestPart extends AnyZodObject ? { - in: { [K in Type]: z.input> } + in: { [K in Type]: z.infer> } out: { [K in Type]: z.output> } } : {} @@ -77,7 +77,7 @@ type InputTypeJson = R['request'] extends RequestTypes : R['request']['body']['content'][keyof R['request']['body']['content']]['schema'] extends ZodSchema ? { in: { - json: z.input< + json: z.infer< R['request']['body']['content'][keyof R['request']['body']['content']]['schema'] > } @@ -100,7 +100,7 @@ type InputTypeForm = R['request'] extends RequestTypes : R['request']['body']['content'][keyof R['request']['body']['content']]['schema'] extends ZodSchema ? { in: { - form: z.input< + form: z.infer< R['request']['body']['content'][keyof R['request']['body']['content']]['schema'] > }