Spring read list property dynamically
With spring it easily possible to read a normal property using env.getProperty(key)
For example if your application.yaml looks like this:
test: "a"
You can read the value like this:
val test = env.getProperty("test")
But now assume you want to read the following application.yaml:
test:
- a: "a"
- b: "b"
How can I read test[a] dynamically?
What does not work unfortunately is this:
val test = env.getProperty("test[a]")