non-empty-discriminator-mapping-value
Overview
This rule belongs to the openapi-v3-apimatic-linting
ruleset and states that:
Discriminator mapping value must specify the name or the reference to the globally defined schema 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 must reference to a globally defined schema.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Empty discriminator mapping value is not allowed. |
Code | OPENAPI3APIMATIC_L804 |
Type | Linting |
Rule System | Semantic |
Broad Category | OpenAPI Discriminators |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi apimatic semantic linting empty discriminator mapping value |
Suggested Fixes
- Make sure that the discriminator mapping values are not null or empty.
- Ensure that the discriminator mapping values are valid schema names or references which are globally defined under the components section in OpenAPI specification.
- Mapping value name is compared in a case-sensitive manner.