56 chars · 5 lines
Waiting for input
56 chars · 5 lines
Waiting for input
YAML sequence troubleshooting
The sample starts a ports sequence correctly, then places the second dash one space too far left. Sequence markers at the same list level must align so the parser can tell which items share a parent. This tool is free to use. No account or payment is required.
Last updated
The dash is not decorative bullet text. Its indentation determines the sequence level, while any mapping nested inside that item needs additional indentation relative to the dash.
When a mapping contains another sequence, keep the parent mapping key, sequence markers, and nested mapping content visibly separated. Consistent two-space indentation is a common convention even though the parser cares about structure rather than one universal width.
The second port dash must align with the first port dash.
services:
- name: api
ports:
- 80
- 443services:
- name: api
ports:
- 80
- 443Common questions
Sibling items in the same sequence should use the same indentation level. Nested sequences use a deeper level under their parent.
Yes. A sequence item can contain a mapping, but the mapping fields must be indented consistently beneath that item.
Indentation determines parent-child relationships in block YAML, so moving a dash can place the item in another sequence or outside the intended block.
Debugging a specific YAML issue? Browse YAML troubleshooting.