YAML's friendly traps
YAML is a superset of JSON that trades braces for indentation — which is exactly where it bites. A few rules save most of the pain:
- Spaces only, never tabs — a single tab character breaks the whole document.
- Indentation is structure — misaligning by one space silently changes the nesting, and therefore the meaning.
- Implicit types — bare
yes/no/on/offbecome booleans,3.20becomes the number3.2(dropping the zero), and a leading-zero value can be read as octal. Quote strings when in doubt. - Anchors & aliases —
&namedefines a reusable block and*namerepeats it; powerful, but easy to misread.
This tool validates with clear line/column errors and converts both ways between YAML and JSON, so you can round-trip an Ansible playbook or a Kubernetes manifest and confirm it parses the way you intended.
Related
- JSON Syntax Tester · Config Template Generator
- Shell & cloud CLIs — where these files get applied.