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.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Blocking |
| Message | Mapping values are not allowed in this context. |
| Code | YAMLSYNTAX_V001 |
| Type | Validation |
| Rule System | Syntax |
| Broad Category | Mapping Values |
| Tags | yaml 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
keypart andvaluepart 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.