3 ms·
Being a superset of JSON, YAML allows you to use braces for maps and square brackets for arrays instead of relying on indentation. You can still omit quotes ar
by andrenth 6y ago
Being a superset of JSON, YAML allows you to use braces for maps and square brackets for arrays instead of relying on indentation.
You can still omit quotes around strings, use comments and add trailing commas after the last element of collections.
A configuration file written in that style is actually pretty nice. I’ve never understood why people don’t use this.
- smitty1e 6y agoBut you can't put comments in JSON. But you can write Python (or pretty much any other tool) and have it emitted as JSON.
- andrenth 6y agoI think you misunderstood. What I meant is that you can put comments in YAML but use JSON-like braces instead of relying on indentation.
- balfirevic 6y agoExcept for omitting quotes around strings, that sounds very similar to json5 [0]. [0] - https://json5.org/ https://json5.org/