Skip to content
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

.openapi() does not exist when extending zod with extendZodWithOpenApi #397

Closed
mauricewegner opened this issue Dec 23, 2024 · 4 comments · Fixed by #398
Closed

.openapi() does not exist when extending zod with extendZodWithOpenApi #397

mauricewegner opened this issue Dec 23, 2024 · 4 comments · Fixed by #398

Comments

@mauricewegner
Copy link

Since 4.2.1 (#393) the extended types are not being supplied when extending zod with extendZodWithOpenApi.

Downgrading to 4.2.0 fixes this issue.

@samchungy
Copy link
Owner

Hey, you might need to check if you have different versions of zod-openapi in your dependencies. Your lockfile is probably a good place to check.

Unfortunately this is a limitation of TypeScript which also affects the main Zod library when they release type changes

@mauricewegner
Copy link
Author

mauricewegner commented Dec 25, 2024

Hey, you might need to check if you have different versions of zod-openapi in your dependencies. Your lockfile is probably a good place to check.

Unfortunately this is a limitation of TypeScript which also affects the main Zod library when they release type changes

Hey @samchungy, thank you for your suggestion. Unfortunately this was not the case. Forcefully overriding all versions of zod-openapi to 4.2.1 and zod to 3.24.1 did not solve the issue. I've created a small reproducible.

@samchungy
Copy link
Owner

Ah gotcha the manual extend is broken. 👀 Looing into it

@samchungy
Copy link
Owner

samchungy commented Dec 25, 2024

Thanks for raising @mauricewegner 🙏 Merry Christmas 🎄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants