title: Custom yml to spring boot application with application.properties
body: <p>I would like to add my own custom.yml file under resources folder and read the config from it, where I already have application.properties and appInfo.properties files.  </p>
  
  <p>When I run the application it throws </p>
  
  <pre><code>Binding to target org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'some.list'  
   Property: some.list.myList
      Value: null
      MyList: must not be null
  </code></pre>
  
  <p>But when I change custom.yml to custom.properties then it works well.</p>
  
  <p>Below is my MainApplication class</p>
  
  <pre><code>@SpringBootApplication
  @SpringBootApplication
  @PropertySources({
      @PropertySource(value = {"classpath:/appInfo.properties"}, ignoreResourceNotFound = true),
      @PropertySource(value = {"classpath:/custom.yml"})
  })
  public class MainApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(MainApplication, args);
      }
  }
  </code></pre>
  
  <p>Below is my config class </p>
  
  <pre><code>@Validated
  @Configuration
  @EnableAutoConfiguration
  @EnableConfigurationProperties
  @ConfigurationProperties(prefix = "some.list")
  public class CustomConfig {
  
      @NotNull
      private List&lt;String&gt; myList;
  
  }
  </code></pre>
  
  <p>src/main/resources/custom.yml</p>
  
  <pre><code>some:
    list:
      my-list:
        - "value 1"
        - "value 2"
  </code></pre>
  
  <p>src/main/resources/application.properties</p>
  
  <pre><code>server.port=8070
  #. other configs
   .
   .
  </code></pre>
  
  <p>src/main/resources/appInfo.properties</p>
  
  <pre><code>info.build.name=@project.name@
  info.build.version=@project.version@-@rpm.release@
  </code></pre>
  
  <p><code>Spring boot version 2.1.2.RELEASE with Java version 8</code></p>
  
  <p>Any lead will be highly appreciated.</p>