Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-11759

@Value annotation should be able to inject List<String> from YAML properties

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Waiting for Triage
    • Component/s: Core
    • Labels:
      None

      Description

      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}"
      
      

        Attachments

          Activity

            People

            • Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              aberlin@pivotallabs.com Adam Berlin
              Last updater:
              St├ęphane Nicoll
            • Votes:
              21 Vote for this issue
              Watchers:
              21 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since last comment:
                44 weeks ago