'How to specify a property placeholder that references a YAML list in Spring configuration?
I use property placeholders to "inject" values into other properties in my YAML config files. Like this:
a:
b: Hello
c: 123
d:
- One
- Two
- Three
x:
y: ${a.b} There
This works well, the value of x.y is resolved as Hello There.
Now I want to reference the entire list a.d, but this does not work:
x:
z: The list is ${a.d}
Spring complains, saying:
Could not resolve placeholder 'a.d' ...
I suspect I can reference individual elements in the a.d list, like a.d[0] but I want the entire list. Is that possible?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
