After reading couple of answers on stackoverflow. I tried to implement the way it was recommended but i am still not getting string list in my component.
Here is my application.yml file
appName:
db:
host: localhost
username: userX
password: passX
driverClassName: org.postgresql.Driver
shipment:
providers:
supported1:
- one
- two
And my component class is
@Component
@ConfigurationProperties(prefix = "appName.shipment.providers")
public class ProviderUtil {
List<String> supported1;
/* This class has other util methods as well */
}
Here, I am expecting that supported1 would have list of strings one and two but it is null. Can someone help what is going on here and how to resolve it ?