Skip to main content

mapping-value-not-allowed

Overview

This rule belongs to the yaml-syntax-validation ruleset and states that:

Mapping values (key-value pairs) should only be used where the YAML specification allows it and the key-value pairs must start and terminate correctly.

PropertyValue
EnabledYes
Maximum SeverityBlocking
MessageMapping values are not allowed in this context.
CodeYAMLSYNTAX_V001
TypeValidation
Rule SystemSyntax
Broad CategoryMapping Values
Tagsyaml data syntax preliminary checks validation yaml key value pairs maps mapping objects

Suggested Fixes

  • (key,value) pairs are not expected here or are used incorrectly.
  • Make sure that for a key-value pair the key part and value part are separated by a colon : and a space e.g. hello: 123
  • If (key,value) pair is expected, ensure it is nested inside the parent property with two spaces (if it is not a root property).
  • If (key,value) pair is expected, ensure it is indented properly as compared to other sibling properties (if any).
  • If (key,value) pair is expected, ensure the value is properly escaped. Try enclosing value in quotes.
  • Ensure content up to this line is valid YAML.

For More Information