---
jsApi: true
title: "[F] getDiscriminatedUnion"

---
```ts
getDiscriminatedUnion(type, discriminator): [DiscriminatedUnion, readonly Diagnostic[]]
```

## Parameters

| Parameter | Type |
| :------ | :------ |
| `type` | [`Model`](Interface.Model.md) \| [`Union`](Interface.Union.md) |
| `discriminator` | [`Discriminator`](Namespace.decorators.Interface.Discriminator.md) |

## Returns

[[`DiscriminatedUnion`](Interface.DiscriminatedUnion.md), *readonly* [`Diagnostic`](Interface.Diagnostic.md)[]]
