required-string-type-for-discriminator-schema-property
Overview
This rule belongs to the openapi-v3-apimatic-linting
ruleset and states that:
The discriminator property is used to differentiate between different subtypes within a schema. This discriminator property, used for polymorphism, must be of type string.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | The type of the discriminator property defined in the schema must be of type string. |
Code | OPENAPI3APIMATIC_L702 |
Type | Linting |
Rule System | Semantic |
Broad Category | OpenAPI Schemas |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi apimatic semantic linting string type property schema discriminator |
Suggested Fixes
- Make sure that the discrimintator property exists in the schema object.
- Make sure that the type of the discriminator property is set to string.
For More Information
- https://www.apimatic.io/
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schema-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#discriminator-object
- https://docs.apimatic.io/rulesets/overview/