3 ms·
All JSON is valid YAML, so you can format your YAML that way and be just fine.
by kstrauser 8y ago
All JSON is valid YAML, so you can format your YAML that way and be just fine.
- Karunamon 8y agoHow the.. I just tried this, and it works, but I don't understand why. I mean YAML is just another data serialization format and so can be trivially converted anyways, but I thought that YAML had completely different formatting rules than JSON.
- kstrauser 8y agoIn the spec (http://yaml.org/spec/1.2/spec.html#id2759572 http://yaml.org/spec/1.2/spec.html#id2759572) it says: > YAML can therefore be viewed as a natural superset of JSON, offering improved human readability and a more complete information model. This is also the case in practice; every JSON file is also a valid YAML file. This makes it easy to migrate from JSON to YAML if/when the additional features are required. I think that's why I absolutely love YAML: I was able to start using it by writing JSON, then replacing parts of my documents with their "native" equivalents as I got comfortable with it.