discriminator-mapping-value-a-valid-model-name
Overview
This rule belongs to the apimatic-preliminary-validation ruleset and states that:
Discriminator mapping value must specify the name of the concrete type/model to which the discriminator value needs to be mapped to. This information is useful for deserialization purposes. Therefore, the value must be non-null, non-empty and match exactly with the name of a pre-defined custom type or model.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Discriminator mapping value is not a valid model name. |
| Code | APIMATICPRE_V585 |
| 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 mapping value discriminator mapping discriminator custom type model complex model type global type combinators anyOf oneOf not |
Suggested Fixes
- Make sure that the discriminator mapping values are not null or empty.
- Ensure that the discriminator mapping values are valid custom type/model names which are globally defined under the Custom Types list.
- Mapping value name is compared in a case-sensitive manner.