valid-swagger-syntax
Overview
This rule belongs to the swagger-v1-validation ruleset and states that:
The provided Swagger document must not contain any syntax/semantic issues and use only valid JSON. Each property in the file must have a type as defined in the standard.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Blocking |
| Message | Provided Swagger definition is invalid. |
| Code | SWAGGER1_V003 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Basic Structure |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | swagger1 swagger semantic validation json syntax |
Suggested Fixes
- Ensure that the file uses valid JSON.
- Ensure that your file is either a valid Resource Listing document or a valid API Declaration document.
- Ensure that each property in the Swagger file has the expected type.
- Ensure that an array is not defined as an object or vice versa.
- Ensure that where a number is expected, a string value is not provided, etc.
- For objects, ensure that each property has a correct type assigned to it.