This rule belongs to the
apimatic-preliminary-validation ruleset and states that:
A discriminator property in a global type combinator definition helps simplify deserialization of model types. This means that the types involved must be complex objects. If only primitive types are expected, a discriminator property is not applicable.
|Message||Discriminator property is not applicable in the current context.|
|Broad Category||Global Types/Models|
|Products Impacted||Code Generation, Developer Experience Portal, API Transformer|
- Use a discriminator only when complex objects are involved in the type combinator (anyOf, oneOf, not) cases.
- Remove any primitive type entry from the type combinator (anyOf, oneOf, not) cases.
- Remove discriminator information if complex objects are not expected.