title: Java Spring POST with array and object JSON data problem
body: <p>I am sending this from the frontend via POST ajax:</p>
  <p>It consists of JSON array and object.</p>
  <p>EDIT: I have set :</p>
  <pre><code>contentType: 'application/json'
  </code></pre>
  <p>The exact JSON is sent as follows:</p>
  <pre><code>{
      &quot;alertKeeperDTOs&quot;: [
          {
              &quot;isSelected&quot;: true,
              &quot;rn&quot;: 0,
              &quot;keeperId&quot;: &quot;B116453993D52735E0530A10CA0A9D27&quot;,
              &quot;keeperName&quot;: &quot;myName&quot;          
          },
          {
              &quot;isSelected&quot;: false,
              &quot;rn&quot;: 1,
              &quot;keeperId&quot;: &quot;65EE22D4A55C4437A4F5552CBFD8D6D0&quot;,
              &quot;keeperName&quot;: &quot;test&quot;,           
          }
      ],
      &quot;deviceId&quot;: 4
  }
  </code></pre>
  <p>I am trying to get this from the Controller:
  (EDITED)</p>
  <pre><code>public @ResponseBody String updateDeviceToKeeperList(@RequestBody List&lt;AlertKeeperDTO&gt; alertKeeperDTOs,
   @RequestBody Long deviceId, HttpServletRequest request){
          ....
      }
  </code></pre>
  <p>But I am getting an error (HTTP 400):</p>
  <blockquote>
  <p>Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize instance of <code>java.util.ArrayList</code> out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of <code>java.util.ArrayList</code> out of START_OBJECT token
  at [Source: (PushbackInputStream); line: 1, column: 1]]</p>
  </blockquote>
  <p>How can I code my controller backend? Please help. Thanks.</p>