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

Add support for ZodUnion #139

Open
BrendanC23 opened this issue Nov 20, 2023 · 0 comments
Open

Add support for ZodUnion #139

BrendanC23 opened this issue Nov 20, 2023 · 0 comments

Comments

@BrendanC23
Copy link

I have a NumberInput component that accepts either a number or an empty string (for invalid or empty input). I would like to model this in zod using z.number().or(z.literal("")), but this gives the error message

No matching zod schema for type ZodUnion found in mapping for property <property>. Make sure there's a matching zod schema for every property in your schema.

I see that discriminated unions are supported. I'd love to be able to use regular unions, too.

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

No branches or pull requests

1 participant