title: Mapping list in Yaml to list of objects in Spring Boot
body: <p>In my Spring Boot app I have application.yaml configuration file with following content. I want to have it injected as a Configuration object with list of channel configurations:</p>
  
  <pre><code>available-payment-channels-list:
    xyz: "123"
    channelConfigurations:
      -
        name: "Company X"
        companyBankAccount: "1000200030004000"
      -
        name: "Company Y"
        companyBankAccount: "1000200030004000"
  </code></pre>
  
  <p>And @Configuration object I want to be populated with list of PaymentConfiguration objects:</p>
  
  <pre><code>    @ConfigurationProperties(prefix = "available-payment-channels-list")
      @Configuration
      @RefreshScope
      public class AvailableChannelsConfiguration {
  
          private String xyz;
  
          private List&lt;ChannelConfiguration&gt; channelConfigurations;
  
          public AvailableChannelsConfiguration(String xyz, List&lt;ChannelConfiguration&gt; channelConfigurations) {
              this.xyz = xyz;
              this.channelConfigurations = channelConfigurations;
          }
  
          public AvailableChannelsConfiguration() {
  
          }
  
          // getters, setters
  
  
          @ConfigurationProperties(prefix = "available-payment-channels-list.channelConfigurations")
          @Configuration
          public static class ChannelConfiguration {
              private String name;
              private String companyBankAccount;
  
              public ChannelConfiguration(String name, String companyBankAccount) {
                  this.name = name;
                  this.companyBankAccount = companyBankAccount;
              }
  
              public ChannelConfiguration() {
              }
  
              // getters, setters
          }
  
      }
  </code></pre>
  
  <p>I am injecting this as a normal bean with @Autowired constructor. Value of xyz is populated correctly, but when Spring tries to parse yaml into list of objects I am getting</p>
  
  <pre><code>   nested exception is java.lang.IllegalStateException: 
      Cannot convert value of type [java.lang.String] to required type    
      [io.example.AvailableChannelsConfiguration$ChannelConfiguration] 
      for property 'channelConfigurations[0]': no matching editors or 
      conversion strategy found]
  </code></pre>
  
  <p>Any clues what is wrong here? </p>