Skip to content

Discriminated Unions not working in zod 4.1.13 #665

@arnolicious

Description

@arnolicious
  • Before posting an issue, read the FAQ and search the previous issues.

Description
With the latest zod version 4.1.13, discriminated unions uses the correct oneOf JSON Schema definition, instead of the previous anyOf definition. Superforms does not currently handle this case, instead throwing an error, that the shape could not be created for the schema

I seem to have a fix, I'll create a PR

Change in zod: colinhacks/zod#5453

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions