title: Nested JSON Mapping to Jackson where key is dynamic
body: <p>I am looking to map a nested JSON structure into Jackson where the object is an object of dynamic IDs.</p>
  
  <pre><code>{ 
       "id1": {
            "prop": true
       },
       "id2": {
            "prop": true
       },
       "id3": {
            "prop": true
       }
   }
  </code></pre>
  
  <p>I currently have the following Jackson POJO:</p>
  
  <pre><code>package com.uk.jacob.containerdroid;
  
  import com.fasterxml.jackson.annotation.JsonAnyGetter;
  import com.fasterxml.jackson.annotation.JsonAnySetter;
  
  import java.util.HashMap;
  import java.util.Map;
  
  public class Container {
      private Map&lt;String, ContainerDetails&gt; properties = new HashMap&lt;&gt;();
  
      public class ContainerDetails {
          private boolean prop;
  
          public boolean getProp() {
              return prop;
          }
  
          public void setProp(boolean prop) {
              this.prop = prop;
          }
      }
  
      @JsonAnySetter
      public void add(String key, ContainerDetails value) {
          properties.put(key, value);
      }
  
      @JsonAnyGetter
      public Map&lt;String, ContainerDetails&gt; getProperties() {
          return properties;
      }
  
      @Override
      public String toString() {
          return "Containers {" +
                      ", properties=" + properties.toString() +
                  '}';
      }
  }
  </code></pre>
  
  <p>Which works for data that is a static property, but not nested JSON.</p>
  
  <p>I get the error:</p>
  
  <pre><code>12-23 22:32:41.628  14098-14098/? W/System.err﹕ at [Source: { "test": { "prop": true } }; line: 1, column: 13] (through reference chain: com.uk.jacob.containerdroid.models.Container["test"])
  </code></pre>
  
  <p>How can I manipulate the above to map properly? </p>