JSON and YAML are the same data
YAML 1.2 is a superset of JSON: every JSON document is valid YAML. Converting only changes the notation — braces and brackets become indentation and dashes. Comments cannot survive a YAML → JSON trip, because JSON has none.
Gotchas when converting YAML to JSON
- Unquoted
yes,no,onandoffare strings in YAML 1.2 (this converter) but booleans in older YAML 1.1 parsers — quote them to be safe. - Values like
1.10become the number 1.1. Quote version numbers. - A file with several
---documents becomes a JSON array.