title: How to define empty list in application.yml in spring boot
body: <p>I've got application.yml in my spring boot project and want to declare empty list. I mean there is a two level config hierarchy. This class is required to get values declared in application.yml</p>
  <pre><code>@Configuration
  @ConfigurationProperties(&quot;book&quot;)
  public class PropertiesReader {
  
      private List&lt;Long&gt; authors;
  
      public List&lt;Long&gt; getAuthors() {
          return new ArrayList&lt;&gt;(authors);
      }
  
      public void setAuthors(List&lt;Long&gt; authors) {
          this.authors= new ArrayList&lt;&gt;(authors);
      }
  </code></pre>
  <p>And this is how part of application.yml looks like</p>
  <pre><code>book:
     library: ${LIBRARY_REFERENCE:library}
     secondValue:
        expirationAfter: 10
     authors: ${AUTHORS_IDS:[]}
  </code></pre>
  <p>So values in curly brackets are declared in another, external configuration file. But if value isn't there declared, spring should assign default value that is declared after colon symbol. In single values it works, but in List if I declare it as above I'm getting NumberFormatException because value <strong>[]</strong> is assigned to list. How to write it properly?</p>
  <p>In external configuration how should it be written also? If I want sometimes to declare values but sometimes it must be empty</p>
  <pre><code>name: AUTHORS_IDS
        value: 
  </code></pre>