title: How can I serialize this JSON using Jackson annotations?
body: <p>I have the following JSON :</p>
  
  <pre><code>{ 
      fields : {
              "foo" : "foovalue",
              "bar" : "barvalue"
      }
  }
  </code></pre>
  
  <p>I wrote a pojo as follows :</p>
  
  <pre><code>public class MyPojo {
  
      @JsonProperty("fields") 
      private List&lt;Field&gt; fields;
  
      static class Field {
          @JsonProperty("foo") private String foo;
          @JsonProperty("bar") private String bar;
  
          //Getters and setters for those 2
  }
  </code></pre>
  
  <p>This fails obviously, because my json field "fields" is a hashmap, and not a list.<br>
  My question is : is there any "magic" annotation that can make Jackson recognize the map keys as pojo property names, and assign the map values to the pojo property values ?</p>
  
  <p>P.S.: I really don't want to have my fields object as a...</p>
  
  <pre><code>private Map&lt;String, String&gt; fields;
  </code></pre>
  
  <p>...because in my real-world json I have complex objects in the map values, not just strings...</p>
  
  <p>Thanks ;-)</p>
  
  <p>Philippe</p>