Issue when java.util.List is used in @ConfigurationProperties and @RefreshScope
Hi spring could team,
I've encountered a problem when a list of values from yml file is mapped to java.util.List in a bean which is @ConfigurationProperties and @RefreshScope.
This issue is when the list values in yml changes and /refresh is done on the client.
New additions and changes to existing entries in list works fine when refreshed but if an entry is removed from yml list - it is never getting updated in the bean property on refresh.
config yml
test:
configurationProperties:
myList:
- value1
- value2
- value3
Java Bean
@ConfigurationProperties(prefix="test.configurationProperties")
@RefreshScope
public class ConfigReader {
private List myList;
When value3 is removed from the yml file and /refresh is posted, myList will still have values value1, value2, value3
Thanks
Since admittedly you need to reach out to the Spring Cloud team, please raise an issue in their project instead. Probably here or here
Done, Thanks! Adding the issue for reference https://github.com/spring-cloud/spring-cloud-config/issues/183