You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I add a bunch of defaults to a z.object in one go, without definiing them individually? (I get them from an api call)
EDIT: I am aware of .transform and .refine, but they return a ZodEffect and not a ZodObject. I also need to use those schemas in .merge. I could use sourceType or innerType but it still doesn't come our right.
Thanks
The text was updated successfully, but these errors were encountered:
Hi, thanks for the great library.
I am to have two version of a schema, one with the fields optional and default values, the other with all fields required.
If I start from the optional version...
and if I start from the required version
How can I add a bunch of defaults to a
z.object
in one go, without definiing them individually? (I get them from an api call)EDIT: I am aware of .transform and .refine, but they return a ZodEffect and not a ZodObject. I also need to use those schemas in .merge. I could use sourceType or innerType but it still doesn't come our right.
Thanks
The text was updated successfully, but these errors were encountered: