astahmer / typed-openapi

Generate a headless Typescript API client from an OpenAPI spec
https://typed-openapi-web.vercel.app/
179 stars 22 forks source link

Update codegen to newest version to support newer validation runtime versions #39

Closed x3cion closed 1 month ago

x3cion commented 1 month ago

Updated the codegen depedency, so newer validation code will be generated. This is a breaking change, if other projects use older versions of the runtime validators.

I did it initially to have a self-referencing schema being correct. Self-referencing schemas fall back to typescript types (instead of e.g. z.infer<>. Codegens model-to-typescript in an older version didn't understand optional parameters and simply parsed all properties as required (property: type instead of property?: type). (See their fixing commit) This conflicted for me with the zod type then, where zod was correct.

I didn't dare to run pnpm changeset.

Let me know if you plan to merge this or not, I might have to fallback to my fork meanwhile.

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
typed-openapi-bzof ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 4, 2024 5:17pm
astahmer commented 1 month ago

sounds good, could you include a changeset ?

x3cion commented 1 month ago

Hope I did it correctly. :)