title: Jackson unable to map JSON to an Object containing a Map
body: <p>I have a Java POJO like so:</p>
  
  <pre><code>public class Widget {
      private Map&lt;String,Object&gt; params;
  
      // Getter, setter, ctor, etc...
  }
  </code></pre>
  
  <p>I have a method that currently receives a JSON <code>String</code>, and is attempting to use Jackson's <code>ObjectMapper</code> to map that JSON into a <code>Widget</code> instance:</p>
  
  <pre><code>public Widget fromJSON(String json) {
      ObjectMapper jsonMapper = new ObjectMapper();
      return jsonMapper.readValue(json, Widget.class);
  }
  </code></pre>
  
  <p>Currently the JSON I'm passing in is:</p>
  
  <pre><code>{
      "params": [{
          "acks": "all"
      }, {
          "retries": 0
      }, {
          "batch.size": 16384
      }, {
          "linger.ms": 1
      }, {
          "buffer.memory": 33554432
      }, {
          "key.serializer": "org.apache.kafka.common.serialization.StringSerializer"
      }, {
          "value.serializer": "org.apache.kafka.common.serialization.StringSerializer"
      }]
  }
  </code></pre>
  
  <p>When this runs I get the following exception:</p>
  
  <pre><code>com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance
      of java.util.LinkedHashMap out of START_ARRAY token
  </code></pre>
  
  <p>I see <a href="https://stackoverflow.com/q/19333106/4009451">this other question</a> addressing a very similar problem, except that question addresses using Jackson to map JSON to a Java <code>Map</code>, not an object (<code>Widget</code>) that <em>contains</em> a Java <code>Map</code>.</p>
  
  <p>I've used <a href="http://jsonlint.com" rel="nofollow noreferrer">http://jsonlint.com</a> to verify that the JSON is valid. <strong>So I either need to change the JSON or the code, or possibly both.</strong> Any ideas?</p>