This is my project structure
- src
- main
- java
- mypackage
- resources
- config
application.yml
and i have this in application.yml
document:
templates:
filetypes:
- elem1
- elem2
- elem3
- elem4
hello:
test: "hello"
in my Endpoint i have the following
@Value("${document.templates.filetypes}")
List<String> templatesFileTypes;
@Value("${document.hello.test}")
String hello;
in any function i can access something like System.out.println(hello)
and its perfectly working
but for the fileTypes its not even compiling and i receive this error :
Error creating bean with name 'configurationEndPoint': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'document.templates.filetypes' in value "${document.templates.filetypes}"
Searched alot and every solution i could find was that pointing to the write application.yml/application.xml file, which is invalid in my case since i can read the other test String but not the array;
i tried String[]
i tried ArrayList<String>
but i can't get it to work