I'm working with a library that uses nested properties for configuration.
E.g.
@Value("${foo.bar}") String fooBar;
@Value("${foo.bar.baz}") String fooBarBaz;
This can be represented successfully in the following properties file:
foo.bar=abc
foo.bar.baz=xyz
However, I've been unable to find a way to represent this in a YML file. Can this even be done? I've tried the following:
// Invalid (ScannerException).
foo:
bar: abc
baz: xyz
// Invalid (NullPointerException).
foo:
bar:
~: abc
baz: xyz
// Invalid (DuplicateKeyException).
foo:
bar: abc
bar:
baz: xyz