Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We should not allow optional, nullish, or nullable on z.coerce schemas #3837

Open
scotttrinh opened this issue Nov 5, 2024 · 0 comments
Open

Comments

@scotttrinh
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant