OpenApiDiscriminator Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Discriminator object.
public class OpenApiDiscriminator : Microsoft.OpenApi.IOpenApiExtensible, Microsoft.OpenApi.IOpenApiSerializable
type OpenApiDiscriminator = class
interface IOpenApiSerializable
interface IOpenApiElement
interface IOpenApiExtensible
Public Class OpenApiDiscriminator
Implements IOpenApiExtensible, IOpenApiSerializable
- Inheritance
-
OpenApiDiscriminator
- Implements
Constructors
| Name | Description |
|---|---|
| OpenApiDiscriminator() |
Parameter-less constructor |
| OpenApiDiscriminator(OpenApiDiscriminator) |
Initializes a copy of an OpenApiDiscriminator instance |
Properties
| Name | Description |
|---|---|
| DefaultMapping |
OAI 3.2.0: The schema name or URI reference to a schema that is expected to validate the structure of the model when the discriminating property is not present in the payload or contains a value for which there is no explicit or implicit mapping. |
| Extensions |
This object MAY be extended with Specification Extensions. |
| Mapping |
An object to hold mappings between payload values and schema names or references. |
| PropertyName |
REQUIRED. The name of the property in the payload that will hold the discriminator value. |
Methods
| Name | Description |
|---|---|
| SerializeAsV2(IOpenApiWriter) |
Serialize OpenApiDiscriminator to Open Api v2.0 |
| SerializeAsV3(IOpenApiWriter) |
Serialize OpenApiDiscriminator to Open Api v3.0 |
| SerializeAsV31(IOpenApiWriter) |
Serialize OpenApiDiscriminator to Open Api v3.1 |
| SerializeAsV32(IOpenApiWriter) |
Serialize OpenApiDiscriminator to Open Api v3.2 |
Extension Methods
| Name | Description |
|---|---|
| Validate(IOpenApiElement, ValidationRuleSet) |
Validate element and all child elements |