Define & Validate APIsValidation RulesetsData Rulesets
YAML Data Semantic Validation
Semantic validation checks performed on provided YAML data to check its conformance to standards.
| Property | Value |
|---|---|
| Ruleset ID | yaml-semantic-validation |
| Code prefix | YAMLSEMANTIC_V |
| Type | Validation |
| Default severity | Blocking |
| Rule system | Semantic |
| Rules | 7 |
Mapping Values
| Code | Rule | Severity | What it checks |
|---|---|---|---|
YAMLSEMANTIC_V001 | valid-block-mapping-key | Blocking | A block mapping is a series of entries consisting of key-value pairs. Key and value of a pair must be separated by a colon : and a space. There must be no other content between the key and the value. |
YAMLSEMANTIC_V002 | valid-flow-mapping | Blocking | A flow mapping is a series of entries consisting of key-value pairs. A flow mapping is surrounded by curly braces { and } respectively while the key-value pair entries are separated by a comma ,. Key and value of a pair must be separated by a colon : and a space. There must be no other content between the key and the value. |
Arrays/Sequences
| Code | Rule | Severity | What it checks |
|---|---|---|---|
YAMLSEMANTIC_V050 | valid-block-sequence-item | Blocking | A block sequence is simply a series of nodes, each denoted by a leading - indicator. The - indicator must be separated from the node by white space. |
YAMLSEMANTIC_V051 | valid-flow-sequence | Blocking | A flow sequence is simply a series of nodes, each denoted by a leading - indicator. The flow sequence is surrounded by square braces [ and ] respectively while the node entries inside it must be separated by a comma ,. The - indicator must be separated from the node entry value by a white-space. |
Directives
| Code | Rule | Severity | What it checks |
|---|---|---|---|
YAMLSEMANTIC_V100 | compatible-yaml-document | Blocking | A YAML document compatibility is mostly verified through the YAML version number specified in the %YAML directive. The %YAML directive and the version number specified in this directive must be valid. |
YAMLSEMANTIC_V101 | valid-yaml-document-start | Blocking | If a YAML document begins with a %YAML directive, it must be followed in the next line by three dashes --- and no other content in it. In other words, the %YAML directive must be valid and separated correctly from the remaining YAML content. |
YAMLSEMANTIC_V102 | single-yaml-directive | Blocking | Only one %YAML directive must exist per YAML file. More than one %YAML directives are not allowed. |