title: How to bind map of custom objects using @RequestBody from JSON
body: <p>I need to send map of custom objects <code>Map&lt;String, Set&lt;Result&gt;&gt;</code> from frontend to backend. </p>
  
  <p>So I think it should be possible to build JSON, send it to Controller via Ajax and receive it in Controller via <code>@RequestBody</code> annotation which should bind json to object. right?</p>
  
  <p>Controller:</p>
  
  <pre><code>@RequestMapping(value = "/downloadReport", method = RequestMethod.POST)
  public ResponseEntity&lt;byte[]&gt; getReport(@RequestBody Map&lt;String, Set&lt;Result&gt;&gt; resultMap) 
  {
      Context context = new Context();
      context.setVariable("resultMap", resultMap);
      return createPDF("pdf-report", context);
  }
  </code></pre>
  
  <p>JSON:</p>
  
  <pre><code>{
    "result": [
      {
        "id": 1,
        "item": {
          "id": 3850,
          "name": "iti"
        },
        "severity": "low",
        "code": "A-M-01",
        "row": 1,
        "column": 1,
        "description": "Miscellaneous warning"
      }
    ]
  }
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>public class Result {
      private Integer id;
      private Item item;
      private String severity;
      private String code;
      private Integer row;
      private Integer column;
      private String description;
      //getter &amp; setters
      //hashCode &amp; equals
  }
  public class Item {
      private Integer id;
      private String name;
      //getter &amp; setters
  }
  </code></pre>
  
  <p>After send such a JSON like above by ajax I am getting error message from browser:</p>
  
  <pre><code>The request sent by the client was syntactically incorrect
  </code></pre>
  
  <p>If I change JSON to send empty set like below then it works but of course my map has empty set:</p>
  
  <pre><code>{"result": []}
  </code></pre>
  
  <p>So, Why I am not able to receive filled map with set of objects? Why binding/unmarshalling do not work as expected and what I should do to make it works? </p>
  
  <p>Note:
  I am using Jackson library and marshalling for other case for <code>@ResponseBody</code> works fine. Problem is with unmarshalling and binding object via <code>@RequestBody</code>.</p>