Closed eli0shin closed 1 year ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
openapi-zod-client | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 18, 2023 4:13am |
I don't have a strong opinion on this, but couldnt this be possible with a custom template already ?
also, this is the default behaviour with https://typed-openapi-astahmer.vercel.app/
Thank you for the quick merge! While it was previously possible with a custom template to export the types that were generated for recursive types. No plain TS types were generated for non-recursive types. I am using a custom template and have broken the schema down as far as possible, generating types in the template wherever I can. Some of the schemas are still large enough that 1 or 2 nodes can't be inferred which means I can't generate a .d.ts from the client.
oh ok, I see the issue you had. out of curiosity, do you reproduce the issue with typed-openapi ?
I have been regularly hitting the "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.ts(7056)" error from typescript when generating clients for large schemas. This library does support generating types but reserves that feature for circular types. This PR adds a non-breaking option to enable TS type generation for all schemas.