@Value annotation should be able to inject List<String> from YAML properties [SPR-11759]
See original GitHub issueAdam Berlin opened SPR-11759 and commented
Yaml file —
foobar:
ignoredUserIds:
- 57016311
- 22588218
Class —
public class Foobar {
@Value("${foobar.ignoredUserIds}")
List<String> ignoredUserIds;
}
Error —
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: java.util.List foobar.Foobar.ignoredUserIds; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'foobar.ignoredUserIds' in string value "${foobar.ignoredUserIds}"
Reference URL: https://github.com/spring-projects/spring-boot/issues/501
21 votes, 21 watchers
Issue Analytics
- State:
- Created 9 years ago
- Reactions:4
- Comments:18
Top Results From Across the Web
Spring Boot: read list from yaml using @Value or ...
I have been able to read list from properties like below way- ... It says Could not resolve placeholder 'fruits' in value "${fruits}"....
Read more >A Quick Guide to Spring @Value - Baeldung
In this quick tutorial, we're going to have a look at the @Value Spring annotation. This annotation can be used for injecting values...
Read more >Spring Boot @Value Annotation - Dan Vega
In this article you will learn about how to set configuration properties and values and then inject them into your application using the...
Read more >Spring @Value Annotation Guide - Coding N Concepts
Learn how to inject values for Primitives, List, Map, Date with inline values and from property file using @Value Annotation.
Read more >Spring @Value annotation tricks - DEV Community
@Value annotation can be used within classes annotated with ... The property value is injected at runtime from the property file to the ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
2021 and it’s still needed 😉
2019 and I need this feature.
@Value
>>>>>@ConfigurationProperties
when there is only one field :private List<String> someList;
Why I need a Class when I only have one field?