We should not allow optional
, nullish
, or nullable
on z.coerce
schemas
#3837
Labels
optional
, nullish
, or nullable
on z.coerce
schemas
#3837
Since
z.coerce.*
schemas will always return the primitive, even if you passundefined
ornull
, we should disallow this. Also, things likez.union([z.coerce.string(), z.coerce.number()])
will always return astring
since the first schema will just always succeed.The text was updated successfully, but these errors were encountered: