YAML formatting and Drupal 8 - making things readable
As someone who loves YAML syntax (so much more pleasant to work with than JSON!), I wanted to jot down a few notes about syntax formatting for the benefit of Drupal 8 developers everywhere.
I often see copy/pasted YAML examples like the following:
object:
child-object: {key: value, key2: {key: value}}
This is perfectly valid YAML. And technically any JSON is valid YAML too. That's part of what makes YAML so powerful—it's easy to translate between JSON and YAML, but YAML is way more readable!
So instead of using YAML like that, you can make the structure and relationships so much more apparent by formatting it like so: