Mapping a list of nested yaml to a list of objects in Spring boot Config
<p>I am using the spring cloud config server/client to get some centralized yaml config represented asshown below:</p>

<pre><code>app:
      workflows:
        - name: name1
          tag : tag1 
          producer:
              acks: all
              retries: 0
          consumer: 
              id: 1
              timeout: 1
        - name: name2
          tag : tag2 
          producer:
              acks: xyz
              retries: 1
          consumer: 
              id: 2
              timeout: 3
</code></pre>

<p>I have an issue getting the nested producer and consumer elements, sofar they are showing up as null within the Config objects. This is what currently was able to have:</p>

<pre><code>@ConfigurationProperties(prefix="app")
public class MSConfiguration {

    private List&lt;Config&gt; workflows = new ArrayList&lt;&gt;();


    public List&lt;Config&gt; getWorkflows() {
        return workflows;
    }



    public static class Config {
        private String name;
        private String tag;
        private Producer producer;
        private Consumer consumer;

        //getters and setters here

    }

    @ConfigurationProperties(prefix="producer")
    public static class Producer {
        private String acks;
        private String retries;

        //getters and setters here

    }

    @ConfigurationProperties(prefix="consumer")
    public static class Consumer {
        private String id;
        private String timeout;

        //getters and setters here
    }
</code></pre>