title: Java - Object Mapper - JSON Array of Number to List<Long>
body: <p>In my front end I send this JSON:</p>
  
  <pre><code>"ids": [ 123421, 15643, 51243],
  "user": {
     "name": "John",
     "email": "john@sovfw.com.br" 
  }
  </code></pre>
  
  <p>To my Spring Endpoint below:</p>
  
  <pre><code>@PostMapping(value = "/sendToOficial")
  public ResponseEntity&lt;?&gt; sendToOficial(@RequestBody Map&lt;String, Object&gt; payload) {
  
  ObjectMapper mapper = new ObjectMapper();
  List&lt;Long&gt; pointsIds = mapper.convertValue( payload.get("pointsIds"), List.class );
  UsuarioDTO autorAlteracao = mapper.convertValue(payload.get("user"), UsuarioDTO.class);
  
  for (Long idPoint : pointsIds) { ... }
  </code></pre>
  
  <p>But I'm getting a Cast Exception in the for saying that it can't cast Integer to Long.</p>
  
  <p>I can't receive the "ids" numbers as Integer, I want to receive as Long.
  Please, how could I do this?</p>