title: Jackson deserializing into Map with an Enum Key, POJO Value
body: <p>I am trying to deserialize JSON into a Java POJO using Jackson. Without giving away confidential information, here is an example stack trace when ObjectMapper's deserialization fails:</p>
  
  <pre><code>org.codehaus.jackson.map.JsonMappingException: Can not construct Map key of type com.example.MyEnum from String "coins": not a valid representation: Can not construct Map key of type com.example.MyEnum from String "coins": not one of values for Enum class
  </code></pre>
  
  <p>My JSON looks like this:</p>
  
  <pre><code>"foo": {
      "coins": null,
      ...
  }
  </code></pre>
  
  <p>And the class I want to deserialize into has this field:</p>
  
  <pre><code>private Map&lt;MyEnum, MyPojo&gt; foo;
  </code></pre>
  
  <p>And my enum type looks like this:</p>
  
  <pre><code>public enum MyEnum {
      COINS("coins"),
      ...
  }
  </code></pre>
  
  <p>I do realize that I am trying to deserialize a null value. But I believe this should still work: the result of the deserialization should be equivalent to having a Map with <code>foo.put(MyEnum.COINS, null)</code>, which is indeed a valid Java instruction. Help is much appreciated, thanks in advance.</p>