I'm trying to deserialize a list of Long values:
{
"ids": [1, 2, 3]
}
With the following Method:
@PostMapping(value = "/export")
public ResponseEntity<SomeDto> exportCsv(@RequestBody Long[] ids) {
// Some methods
return ResponseEntity.ok(someDto);
}
But I keep getting the following error: JSON parse error: Cannot deserialize value of type Long. The Error is the same using List<Long>, just for ArrayList<Long>.
I've tried it with @JsonDeserialize(using = NumberDeserializers.LongDeserializer.class), but it seems either it doesn't work or I'm using it wrong.