ZodZ
Zod3y ago
Steve

Scott Trinh Would you be able to help

@Scott Trinh Would you be able to help me out? I have some complex schema:

export const PublicatietoolRootElementSchema = z.union([
    PublicatietoolElementHeadingSchema,
    PublicatietoolElementImageSchema,
    PublicatietoolElementListOrderedSchema,
    PublicatietoolElementListUnorderedSchema,
    PublicatietoolElementQuotationSchema,
    PublicatietoolElementTableSchema,
    PublicatietoolElementTextSchema,
]);


But the .Union doesn't work, most of them have overlapping fields, and they have one discriminator:
.type
Was this page helpful?