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/off become booleans, 3.20 becomes the number 3.2 (dropping the zero), and a leading-zero value can be read as octal. Quote strings when in doubt.
  • Anchors & aliases&name defines a reusable block and *name repeats 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