Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityBlocking
MessageProvided RAML v0.8 JSON file is not valid.
CodeRAML_V002
TypeValidation
Rule SystemSemantic
Broad CategoryBasic Structure
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsraml 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.

For More Information