YAML is supposed to be a "human-friendly" configuration language, however "simple" deeply nested configuration values can sometimes end up looking kind of ugly and hard to read:
system:
config:
subsystem:
project:
name: "coolproject"
version: "1.0.0"
stages:
- something:
name: "foo"
- something:
name: "bar"
- something:
name: "baz"
Is there some way to collapse such deeply nested configurations? In particular, I would like to be able to "squash" the levels in simple nested structures (levels that have only one child).
Ideally, I would have liked to be able to do something along the lines of
system: config: subsystem: project:
name: "coolproject"
version: "1.0.0"
stages:
- something: name: "foo"
- something: name: "bar"
- something: name: "baz"
but this isn't valid YAML. Other attempts like system:config:subsystem:project:
(without spaces), system.config.subsystem.project:
and system/config/subsystem/project:
didn't work either (well, they did work, but they are represented as keys with colons, dots or slashes in them, rather than nested stuctures).
A cursory reading of the spec also seems to indicate that there is no support for such a thing, but I still decided to ask this question, in case I have missed some clever trick or workaround.