-
Notifications
You must be signed in to change notification settings - Fork 190
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
Compatibility with inferred types from zod #758
Comments
Thanks for the issue. To debug this, I suggest inlining |
@matt-pawley we're running into a similar issue (using https://github.com/env0/serverless-openapi-typescript). Did you end up finding a way forward? This is the error we're getting when a type that uses zod infer is encountered. In this case
|
I also ran into this and found a fix for the problem: #1947 I don't understand the purpose of the |
Hi, our codebase for various reasons has a mix of zod types and typescript types.
We are hoping to generate JSON schema from the typescript types (which in turn use inferred zod types). However upon trying we get the following error
TypeError: Cannot read property 'types' of undefined
which is thrown hereA minimal reproducible example is below:
Can be ran with
npx ts-json-schema-generator --path ./foo.ts --type Example
Appreciate this is probably out of the remit of this library, but would it be something you would be open to having a PR for? If so, could point me in the right direction to fix ?
The text was updated successfully, but these errors were encountered: