Skip to main content


A Union represents a Type whose value can be one of a set of other Types.

This is conceptually similar to an Enum, in that it constrains the set of possible values of instances of the Union. However it is less restrictive than a single Type, because values can be of any of the Types in the Union.


The following example specifies that can only be one of string, int32 or TypeUUID:

  !type TypeUUID:    id <: string
  !union UnionType:    string    int32    TypeUUID
  !type User:    id <: UnionType

See also#

External references: