Skip to content

Add support for ZodUnion #139

@BrendanC23

Description

@BrendanC23

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions