title: Spring @ConfigurationProperties inheritance/nesting
body: <p>How do I load configuration to create a list of <strong>Shape</strong>s which inherits defaults and also support overriding?</p>
  
  <p>Here is how my application.yml files looks like...</p>
  
  <pre><code>store:
    default:
      color: red
      size: 10
  
    shapes:
      - id: square
        size: 20
  
      - id: circle
        size: 30
        color: black
  
      - id: rectangle
  </code></pre>
  
  <p>And here is what I want...</p>
  
  <pre><code>{
    "catalog": {
      "shapes": [
        {
          "color": "red",    // default
          "size": 20,        // override
          "id": "square"
        },
        {
          "color": "black",  // override
          "size": 30,        // override
          "id": "circle"    
        },
        {
          "color": "red",    // default
          "size": 10,        // default
          "id": "rectangle"  
        }
      ]
    }
  }
  </code></pre>
  
  <p>So far I have tried following but its missing defaults in the inheritance. In other words, the defaults never makes into <strong>Shape</strong>s object.</p>
  
  <pre><code>@lombok.Data
  @Component
  @ConfigurationProperties(prefix = "store")
  public class Catalog {
      private List&lt;Shape&gt; shapes;   
  }
  
  @lombok.Data
  public class Shape extends DefaultConfig {
      private String id;
  }
  
  @lombok.Data
  @ConfigurationProperties(prefix = "store.default")
  @Component
  public class DefaultConfig {
      private String color;
      private int size;
  }
  </code></pre>