Closed marrowleaves closed 8 months 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 | Dec 21, 2023 0:40am |
thank you for working on this ! could you add a changeset so I can merge it ?
thank you for working on this ! could you add a changeset so I can merge it ?
Sure, changeset text generated
This is an attempt to fix #257
Now
getZodSchema
would treat schema object withrequired
defined as an array of typeobject
and correctly infer the type. The fix also checks extra properties inrequired
array but not defined inproperties
, inferred as additional props.The fix doesn't handle the case when
additionalProperties
are defined and mixed withrequired
array. It seems that the current implementation doesn't handle the mix ofadditionalProperties
andproperties
either. But it would be easy to append theextraProperties
string generated fromrequired
to the code string generated foradditionalProperties
, after it's properly handled.