Zod · Function
z.union
z.union() validates input against several schemas. It succeeds when one option matches and returns the first successful result.
Last updated
Syntax
z.union([schemaA, schemaB, ...])In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
z.xor()z.discriminatedUnion()z.intersection()options