This rule belongs to the
apimatic-preliminary-validation ruleset and states that:
If a discriminator is set for the model, a corresponding discriminator field should be part of the model fields. This discriminator field should be optional and of "String" type only. The name of the discriminator field must match with the name of the discriminator set in the model.
|Message||The discriminator field defined in the model is invalid.|
|Broad Category||Global Types/Models|
|Products Impacted||Code Generation, Developer Experience Portal, API Transformer|
- Make sure there is only one field named equal to the discriminator in the model and that it is optional. Remove all other conflicting fields.
- Make sure the discriminator field is string-typed. Other types (including enumerations) are not supported.