Skip to content

Commit

Permalink
fix(zod-openapi): relax input types (#211)
Browse files Browse the repository at this point in the history
* fix(zod-openapi): relax input types

* changeset
  • Loading branch information
yusukebe authored Oct 26, 2023
1 parent cb5bba4 commit 6ca8e8d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-poets-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hono/zod-openapi': patch
---

fix: relax input types
6 changes: 3 additions & 3 deletions packages/zod-openapi/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>> }
}
: {}
Expand All @@ -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']
>
}
Expand All @@ -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']
>
}
Expand Down

0 comments on commit 6ca8e8d

Please sign in to comment.