valid-schema-type
Overview
This rule belongs to the swagger-v2-standards-validation ruleset and states that:
The property type in a Schema Object can have only of the following values: array, object, boolean, integer, number, string. Type null and other types are not allowed.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Schema type is invalid. |
| Code | SWAGGER20STANDARDS_V300 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Schemas |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | swagger2 swagger standards semantic validation data type type schema primitive complex object array |
Suggested Fixes
- Type names are compared in a case-sensitive manner.
- Ensure that the schema type is not empty or null.
- Remove any trailing or leading whitespace or newline characters from the type value.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#schema-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#data-types
- https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-04#section-3.5
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md
- https://docs.apimatic.io/rulesets/overview/