{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/6235","repository_url":"https://api.github.com/repos/spring-projects/spring-boot","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/6235/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/6235/comments","events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/6235/events","html_url":"https://github.com/spring-projects/spring-boot/issues/6235","id":162453331,"number":6235,"title":"List type configuration property bug","user":{"login":"mkopylec","id":11982847,"avatar_url":"https://avatars.githubusercontent.com/u/11982847?v=3","gravatar_id":"","url":"https://api.github.com/users/mkopylec","html_url":"https://github.com/mkopylec","followers_url":"https://api.github.com/users/mkopylec/followers","following_url":"https://api.github.com/users/mkopylec/following{/other_user}","gists_url":"https://api.github.com/users/mkopylec/gists{/gist_id}","starred_url":"https://api.github.com/users/mkopylec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkopylec/subscriptions","organizations_url":"https://api.github.com/users/mkopylec/orgs","repos_url":"https://api.github.com/users/mkopylec/repos","events_url":"https://api.github.com/users/mkopylec/events{/privacy}","received_events_url":"https://api.github.com/users/mkopylec/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spring-projects/spring-boot/labels/invalid","name":"invalid","color":"e6e6e6"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-06-27T13:35:46Z","updated_at":"2016-06-28T08:13:20Z","closed_at":"2016-06-28T07:48:23Z","body":"I have a configuration class:\r\n```java\r\n@ConfigurationProperties(\"sample\")\r\npublic class SampleProperties {\r\n\r\n    private List<String> types = new ArrayList<>(asList(\"type1\", \"type2\"));\r\n\r\n    public List<String> getTypes() {\r\n        return types;\r\n    }\r\n\r\n    public void setTypes(List<String> types) {\r\n        this.types = types;\r\n    }\r\n}\r\n```\r\nand _application.yml_ file (note the notation with `-`):\r\n```yaml\r\nsample.types: \r\n    - type3\r\n```\r\nNow I expect that `sampleProperties.getTypes()` will return `[\"type3\"]` but what it really returns is `[\"type3\", \"type2\"]`. Just the first element of the list has been overriden.\r\nI suppose that `List` config properties are not overridable like the other ones (String, primitives, etc.)\r\nIn my opinion it is a bug.\r\nI'm using **1.3.5.RELEASE** version.\r\n\r\nDifferent things happen in the list of `Class`es:\r\n\r\n```java\r\n@ConfigurationProperties(\"sample\")\r\npublic class SampleProperties {\r\n\r\n    private List<Class> types = new ArrayList<>(asList(IOException.class, TimeoutException.class));\r\n\r\n    public List<Class> getTypes() {\r\n        return types;\r\n    }\r\n\r\n    public void setTypes(List<Class> types) {\r\n        this.types = types;\r\n    }\r\n}\r\n```\r\nand _application.yml_ file (note the notation without `-`):\r\n```yaml\r\nsample.types: java.lang.RuntimeException, java.lang.Exception\r\n```\r\nNow I expect `types` to be `[java.lang.RuntimeException, java.lang.Exception]` but they are `[IOException.class, TimeoutException.class]`"},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/comments/228981962","html_url":"https://github.com/spring-projects/spring-boot/issues/6235#issuecomment-228981962","issue_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/6235","id":228981962,"user":{"login":"mkopylec","id":11982847,"avatar_url":"https://avatars.githubusercontent.com/u/11982847?v=3","gravatar_id":"","url":"https://api.github.com/users/mkopylec","html_url":"https://github.com/mkopylec","followers_url":"https://api.github.com/users/mkopylec/followers","following_url":"https://api.github.com/users/mkopylec/following{/other_user}","gists_url":"https://api.github.com/users/mkopylec/gists{/gist_id}","starred_url":"https://api.github.com/users/mkopylec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkopylec/subscriptions","organizations_url":"https://api.github.com/users/mkopylec/orgs","repos_url":"https://api.github.com/users/mkopylec/repos","events_url":"https://api.github.com/users/mkopylec/events{/privacy}","received_events_url":"https://api.github.com/users/mkopylec/received_events","type":"User","site_admin":false},"created_at":"2016-06-28T08:13:20Z","updated_at":"2016-06-28T08:13:20Z","body":"Thanks, for the explanation.\r\nOk, I will create a separate issue and provide a sample project."}}
{"actor":{"display_login":"mkopylec"}}