-
Notifications
You must be signed in to change notification settings - Fork 148
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
fix(zod-openapi): Fix basePath method to transfer defaultHook of the parent app. #408
Conversation
🦋 Changeset detectedLatest commit: 828e136 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 |
@@ -1270,7 +1279,9 @@ describe('Named params in nested routes', () => { | |||
it('Should return a correct path', async () => { | |||
const res = await root.request('/doc') | |||
expect(res.status).toBe(200) | |||
const data = await res.json() | |||
const data: { |
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.
I think this change is not necessary. What is it for?
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.
You are right, this is not necessary per se. That code was showing typescript error so I just fixed it so I could run the whole test suite.
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.
We can ignore the typescript error, so please remove it!
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.
Ok. Removed.
Hi @DavidHavl Thank you for the PR. I've left the comment. And could you run |
Thanks! Last one. thing. Run |
Done |
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.
LGTM!
Merge now. Thanks! |
There is currently an issue with basePath method where it does not transfer defaultHook to the newly created instance.
This pull request fixes it.
In the following code (taken from the current docs) the defaultHook is never called because it does not exist on the new instance created when basePath method is called.