OAS:OpenAPI Editor/Schema Discriminator
When request bodies or response payloads may be one of a number of different schemas, a discriminator object can be used to aid in serialization, deserialization, and validation. A discriminator is a specific object in a schema that is used to inform the consumer of the specification of an alternative schema based on the value associated with it.
Add Discriminator Property Name
To add the discriminating property name, select the concerned schema, go to the Discriminator tab. Then fill in the property name.
Optionally, to get content assistance drop-down in the property name field, click inside it then hit Ctrl and Space at the same time. A drop down with available properties from the current schema will be shown to select from.
Note: A discriminator property should be a required one. So, don't forget to set it as required in the Properties tab by checking the check-box beside it.See here schema properties how-to
Add Discriminator Mapping
You can add a mapping to a schema discriminator by selecting the concerned schema. Then go to the Discriminator tab. Click the Add mapping link from the toolbar. Two input fields show up. The first is for the mapping name and the second is for the mapping value. Fill in the name and value.
Optionally, to get content assistance in the mapping value field, click inside it then hit Ctrl and Space at the same time. A drop down with available schemas in the current document will be shown. Select one then the full schema reference will automatically be built and filled in for you.
Delete Discriminator Mapping
To delete a mapping, click the delete button X beside the mapping you want to delete.