The widespread usage of JSON as a configuration format is disappointing.
JSON is intended to be and is primarily advertised as a lightweight data-interchange format. And for this use case it really shines. However as a configuration format it falls short on multiple aspects, compared to YAML, which I highlight below (examples taken from Learn X in Y minutes ):
a_nested_map:
key: value
another_key: Another Value
another_nested_map:
hello: hello
literal_block: |
This entire block of text will be the value of the 'literal_block' key,
with line breaks being preserved.
The literal continues until de-dented, and the leading indentation is
stripped.
Any lines that are 'more-indented' keep the rest of their indentation -
these lines will be indented by 4 spaces.
folded_style: >
This entire block of text will be the value of 'folded_style', but this
time, all newlines will be replaced with a single space.
Blank lines, like above, are converted to a newline character.
'More-indented' lines keep their newlines, too -
this text will appear over two lines.
JSON in contrast does not have support for multiline strings.
This is particularly useful when configuration files are being used for internationalization.
# Anchors can be used to duplicate/inherit properties
base: &base
name: Everyone has same name
foo: &foo
<<: *base
age: 10
bar: &bar
<<: *base
age: 20
# Strings and numbers aren't the only scalars that YAML can understand.
# ISO-formatted date and datetime literals are also parsed.
datetime: 2001-12-15T02:59:43.1Z
datetime_with_spaces: 2001-12-14 21:59:43.10 -5
date: 2002-12-14
Plus many others.
Also it is noteworthy that YAML is officially a super set of JSON so migrating from JSON to YAML is effortless.