Define & Validate APIsValidation RulesetsData Rulesets

YAML Data Syntax Validation

Syntax validation checks performed on provided YAML data to check its conformance to standards.

PropertyValue
Ruleset IDyaml-syntax-validation
Code prefixYAMLSYNTAX_V
TypeValidation
Default severityBlocking
Rule systemSyntax
Rules11

Mapping Values

CodeRuleSeverityWhat it checks
YAMLSYNTAX_V001mapping-value-not-allowedBlockingMapping values (key-value pairs) should only be used where the YAML specification allows it and the key-value pairs must start and terminate correctly.
YAMLSYNTAX_V002required-mapping-value-colon-separationBlockingThe key and value of a mapping (key-value pair) must be separated by a colon :. There must be a space between the colon : and the value.
YAMLSYNTAX_V003no-reserved-keywords-in-unquoted-mapping-keyBlockingThe key content of the key-value pair (or mapping) must not use null unless it is intended to be a property name in which case it must be enclosed in quotes. Similarly, use of any other YAML reserved keywords must be avoided as key names unless they be enclosed in quotes.

Scalars

CodeRuleSeverityWhat it checks
YAMLSYNTAX_V050escaped-quoted-scalarBlockingA quoted scalar value must be escaped properly. A scalar value (like a number, string, etc.) can be quoted in two styles: single or double. The double-quoted style provides escape sequences. The single-quoted style is useful when escaping is not needed. If your scalar value needs escaping, use double quotes and appropriate escape sequences.
YAMLSYNTAX_V051valid-quoted-scalar-terminationBlockingA scalar value (like a number, string, etc.) can be quoted in two styles: single quotes or double quotes. Whatever style is picked for the scalar must be used consistently for it i.e. use either single quotes or double quotes but not both. There must be a quote before the value and after the value.

Indentation

CodeRuleSeverityWhat it checks
YAMLSYNTAX_V100valid-character-before-token-startBlockingA YAML token must be indented with spaces. Any other character used before the YAML token like tabs \t, etc. is not allowed
YAMLSYNTAX_V101no-tab-indentationBlockingA YAML token must be indented with spaces. Tab indentation using \t is not allowed and should be replaced with spaces.

Directives

CodeRuleSeverityWhat it checks
YAMLSYNTAX_V150required-directive-nameBlockingDirectives are instructions to the YAML processor. They are identified by their name which is required and cannot be empty or null.
YAMLSYNTAX_V151valid-yaml-directive-version-numberBlockingThe %YAML directive specifies the version of YAML the document conforms to. Documents explicitly specifying a YAML directive must only use a valid YAML version number after the directive name e.g. %YAML 1.2.

Anchors

CodeRuleSeverityWhat it checks
YAMLSYNTAX_V175resolvable-node-anchorBlockingA node can be anchored using & followed by an anchor name. This anchored node can then be referenced by an alias node using * followed by the anchor name. The anchor name used by the alias node must be valid and an anchored node of that name must exist.

Miscellaneous

CodeRuleSeverityWhat it checks
YAMLSYNTAX_V200valid-yamlBlockingYAML data must follow standards defined in the official YAML specification.

Learn more

On this page