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
Please add support for z.union() in validation schemas for shadcn Vue. Currently, using z.union() to handle multiple types (e.g., z.string().email() and z.literal('') for optional/nullable fields) is not supported, which limits flexibility.
Describe the feature
Please add support for
z.union()
in validation schemas for shadcn Vue. Currently, usingz.union()
to handle multiple types (e.g.,z.string().email()
andz.literal('')
for optional/nullable fields) is not supported, which limits flexibility.For example, this schema for an optional email:
renders nothing, likely skipping the field altogether.
Using this:
renders an email field, but when the value is removed, it still shows an invalid email error.
This issue on the Zod repo explains how to define an optional email field using
z.union()
for proper validation.Additional information
The text was updated successfully, but these errors were encountered: