I have this PostMapping method
@PostMapping("/offreStage/{id}/users")
public ResponseEntity<?> addAuthorizedStudents(@PathVariable Long id,
@RequestBody Map<String, String> students) {
return service.addAuthorizedStudentsToOffer(id, students);
}
and I use the following JSON payload to make my post request:
[
{
"value": 15,
"label": "student2@gmail.com"
},
{
"value": 14,
"label": "student21@gmail.com"
}
]
This returns the following:
"message": "JSON parse error: Cannot deserialize instance of
java.util.LinkedHashMap
out of START_ARRAY token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance ofjava.util.LinkedHashMap
out of START_ARRAY token\n at [Source: (PushbackInputStream); line: 1, column: 1]",