"Lists are represented as comma-separated values (useful for simple String values) and also as property keys with [] dereferencers..."
The example even says that the following yaml:
I've provided a simple JUnit test to illustrate the issue. It has 3 tests, two with the [] dereferencers, and one with the comma-separated values.
The first and second tests pass, but the last one fail.
I've reproduced it in 4.2.1.RELEASE and 4.2.2.BUILD-SNAPSHOT.
I believe the documentation is wrong. The CSV view of arrays was a Spring Boot feature in 0.5.0 and I believe we squashed it in 1.x somewhere (probably before 1.0). The reason it doesn't work very well is that you end up with 2 representations of the same data in one Map (or PropertySource or whatever). Consequently anyone wanting to bind to it has too many choices, and it will break some of the nice stuff you get for free otherwise in Spring binding.
Florian Morgan opened SPR-13527 and commented
YamlPropertiesFactoryBean doesn't generate the comma-separated list property value.
The JavaDoc states that :
would become the following java properties:
I've provided a simple JUnit test to illustrate the issue. It has 3 tests, two with the [] dereferencers, and one with the comma-separated values.
The first and second tests pass, but the last one fail.
I've reproduced it in
4.2.1.RELEASE
and4.2.2.BUILD-SNAPSHOT
.Affects: 4.2.1
Attachments:
The text was updated successfully, but these errors were encountered: