Skip to content

Support for lazy #599

Open
Open
@sschneider-ihre-pvs

Description

@sschneider-ihre-pvs

There is a chance that there will be some self referencing group going on which is currently not supported but is possible in Zod for example

This leads to callstack size exceeded

export function GroupSchema {
  return z.object({
    name: z.string(),
    subGroup:  GroupSchema()
  })
}

This does not

export function GroupSchema {
  return z.object({
    name: z.string(),
    subGroup: z.lazy(() => GroupSchema())
  })
}

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