valid-json-raml
Overview
This rule belongs to the raml-validation
ruleset and states that:
The legacy RAML v0.8
format unofficially supports a RAML+JSON version where RAML files could be defined using JSON instead of the default YAML syntax. APIMatic also supports such files. However, they must not contain any syntax/semantic issues and should use only valid JSON.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Blocking |
Message | Provided RAML v0.8 JSON file is not valid. |
Code | RAML_V002 |
Type | Validation |
Rule System | Semantic |
Broad Category | Basic Structure |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | raml semantic validation raml json json |
Suggested Fixes
- Ensure that the file uses valid JSON.
- Ensure that each element in the RAML 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.