I am trying to inject a list of maps from my application.yml configuration file into my Spring Boot service. Here is the configuration in application.yml:
devoxx:
cfpApis:
-
url: http://cfp.devoxx.be/api/conferences
youtubeChannelId: UCCBVCTuk6uJrN3iFV_3vurg
-
url: http://cfp.devoxx.fr/api/conferences
-
url: http://cfp.devoxx.ma/api/conferences
youtubeChannelId: UC6vfGtsJr5RoBQBcHg24XQw
-
url: http://cfp.devoxx.co.uk/api/conferences
-
url: http://cfp.devoxx.pl/api/conferences
And here is my property in my service:
@Value("devoxx.cfpApis")
List<Map<String,String>> cfpApis
But there must be something wrong because when I try to run my application, I get the following exception:
java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [java.util.Map]: no matching editors or conversion strategy found
Any idea of what I'm doing wrong?
FYI, I'm trying to migrate a Grails 3 project into a vanilla Spring Boot project and this configuration works in Grails 3, but Grails has its own YAML processors.