YAML vs JSON: when to use each
How YAML and JSON differ, where each one fits, and what changes when you convert between them.
Readability and syntax
YAML relies on indentation and minimal punctuation, which makes it pleasant to hand-edit for configuration. JSON uses explicit braces, brackets and quotes, which makes it strict and easy for machines to parse.
What converts cleanly
Mappings become objects, sequences become arrays, and scalars become strings, numbers, booleans or null. The data model is the same, so the structure carries over directly.
What you lose
JSON has no comments and no concept of anchors, so comments are removed and anchors and aliases are expanded into their resolved values during conversion.