-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(zod-openapi): Make it possible to do method chaining even for do… #260
feat(zod-openapi): Make it possible to do method chaining even for do… #260
Conversation
🦋 Changeset detectedLatest commit: d4f9480 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
f082af5
to
9e910c4
Compare
9e910c4
to
904fb48
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Karibash
Yeah, it's complicated as you said. I've left the comments.
packages/zod-openapi/src/index.ts
Outdated
doc = <P extends string>( | ||
path: P, | ||
config: OpenAPIObjectConfig | ||
): OpenAPIHono<E, S & ToSchema<'get', P, {}, OpenAPIObject>, BasePath> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The below is OK.
OpenAPIHono<E, S & ToSchema<'get', P, {}, {}>, BasePath>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this method does not use the jsonT method
Yes, you are right. It does not use jsonT()
! Your fix is good.
packages/zod-openapi/src/index.ts
Outdated
doc31 = <P extends string>( | ||
path: P, | ||
config: OpenAPIObjectConfig | ||
): OpenAPIHono<E, S & ToSchema<'get', P, {}, OpenAPIObject>, BasePath> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
3915c72
to
d4f9480
Compare
Thanks! Looks good to me. I'll merge this now. |
…c methods
I implemented it so that doc methods can also do method chaining.
I am not so sure if I implemented it properly because the type is too complicated.