title: Mapping a list of objects from application.yml with custom "root key" in Spring Boot
body: <p>I have setup the following configuration class for a Spring Boot application:</p>
  <pre class="lang-java prettyprint-override"><code>@Configuration
  @ConfigurationProperties(prefix = &quot;tasks&quot;)
  @Getter
  @Setter
  public class TaskConfiguration {
      
      private List&lt;TaskEntry&gt; tasks;
  
      @Getter
      @Setter
      public static class TaskEntry {
          private String name;
          private String url;
          private String cronExpression;
      }
  }
  </code></pre>
  <p>The <code>application.yml</code> defines the following values which can be read correctly in the application:</p>
  <pre class="lang-yaml prettyprint-override"><code>tasks:
      tasks:
      - name: A
        url: http://localhosta
        cronExpression: 1 2 3 4 5 A
      - name: B
        url: http://localhostb
        cronExpression: 1 2 3 4 5 B
  </code></pre>
  <p>However, you might have noticed that there is a duplicated <code>tasks</code> key in the configuration file. I couldn't find out yet how to get rid of it so that the YAML would look like this:</p>
  <pre class="lang-yaml prettyprint-override"><code>tasks:
      - name: A
        url: http://localhosta
        cronExpression: 1 2 3 4 5 A
      - name: B
        url: http://localhostb
        cronExpression: 1 2 3 4 5 B
  </code></pre>