z.object().coerce() please? Same as z.object().partial() or .required(), making some or all properties "coerced" #5450
sebastienbarre
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Given a schema, I'm trying to get the equivalent schema where specific fields are now
z.coerce....then
would return:
Not going to lie, I’m a TypeScript and Zod newbie, so I asked an AI for help (sorry), and the resulting function was so massive it pretty much confirmed this is non-trivial. I’d really prefer to get some human input on how to implement this.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions