required-discriminator-value
Overview
This rule belongs to the apimatic-preliminary-validation ruleset and states that:
A model containing a discriminator in its type hierarchy must have a discriminator value set in its definition.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | The discriminator value for model is missing. |
| Code | APIMATICPRE_V508 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Global Types/Models |
| Products Impacted | Code Generation, Developer Experience Portal, API Transformer |
| Tags | preliminary checks validation apimatic discriminator value discriminator base type inheritance type custom type model complex model |
Suggested Fixes
- Set the discriminator value of the model.
- The discriminator value must be non-null and non-empty.
- Set the base type as null if you do not want the model to belong to the type hierarchy.