# Function union

- union<D extends string | Discriminant<any, any>, U extends UnionSubtypes<any>>(
  discriminant: D,
  union: U,
  ): ObjectLikeSchema<inferRawUnion<D, U>, inferParsedUnion<D, U>>

  #### Type Parameters

  - D extends string | Discriminant<any, any>
  - U extends UnionSubtypes<any>

  #### Parameters

  - discriminant: D
  - union: U

  #### Returns ObjectLikeSchema<inferRawUnion<D, U>, inferParsedUnion<D, U>>

  - Defined in engine/sdks/typescript/api-full/types/core/schemas/builders/union/union.d.ts:4