We should not allow `optional`, `nullish`, or `nullable` on `z.coerce` schemas
scotttrinh opened this issue · comments
Scott Trinh commented
Since z.coerce.*
schemas will always return the primitive, even if you pass undefined
or null
, we should disallow this. Also, things like z.union([z.coerce.string(), z.coerce.number()])
will always return a string
since the first schema will just always succeed.