title: Mapping List in YAML file to List of objects
body: <p>I'm trying to inject list in my application.yml file to list of objects Java in my Spring Boot application.</p>
  
  <p>I have seen some answers to others similar questions <a href="https://stackoverflow.com/questions/32593014/mapping-list-in-yaml-to-list-of-objects-in-spring-boot">Mapping list in Yaml to list of objects in Spring Boot</a> but I have differents output errors.</p>
  
  <p>My YAML file</p>
  
  <pre><code>s3tool:
     buckets:
       -
        name: myentity1
        accessKey: access
        secretKey: secret
        endpoint: endepoint
        proxyPort: 3128
        proxyHost: gateway-address
       -
        name: myentity2
        accessKey: access
        secretKey: secret
        endpoint: endepoint
        proxyPort: 3128
        proxyHost: gateway-address
  </code></pre>
  
  <p>I have also created Bucket class</p>
  
  <pre><code> public class Bucket {
  
         private String name;
  
         private String accessKey;
  
         private String secretKey;
  
         private String endpoint;
  
         private String proxyHost;
  
         private int proxyPort;
  
        //getters and setters
    }
  </code></pre>
  
  <p>And my configuration class where I inject the list in YAML</p>
  
  <pre><code>    @Configuration
      @EnableConfigurationProperties
      @ConfigurationProperties
      public class S3ClientHelper {
  
          @Value("${s3tool.buckets}")
          private List&lt;Bucket&gt; buckets;
  
     //others methods 
     }
  </code></pre>
  
  <p>When Spring Boot starts excuting I got the following error:</p>
  
  <pre><code>  Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 's3tool.buckets' in value "${s3tool.buckets}"
  </code></pre>
  
  <p>I have also tried with simple list of String but I also got the similar error.
  How can I do it?</p>