Skip to content

ConfigurationProperties overwrites with list behaves oddly #6793

@cleiter

Description

@cleiter

I have an application.yml:

service:
  hosts:
    - a

And the configuration:

@Component
@ConfigurationProperties("service")
class Config {
    private List<String> hosts;

    public List<String> getHosts() { return hosts; }

    public void setHosts(List<String> hosts) { this.hosts = hosts; }
}

When i set the environment variable SERVICE_HOSTS=b,c the result in my Config is actually [a, c] when I expected [b, c]. I tried if this is specific to lists but the same happens with arrays. Same behavior in 1.4.0.RELEASE and current 1.4.1.BUILD-SNAPSHOT.

Metadata

Metadata

Assignees

No one assigned

    Labels

    theme: config-dataIssues related to the configuration theme

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions