I'm struggling with an issue where I have a hard-coded JSON object that is supposed to map to my POJO in Spring Controller, but I keep getting null values. I have double-checked my getters and setters, and everything seems to be correct. Can anyone help me figure out what I am doing wrong?
Controller
@PostMapping("/dashboard")
public Dashboard getDashboard(@RequestBody PaginationRequest paginationRequest) {
return topcatService.getDashboard(paginationRequest);
}
JSON
var paginationRequest = { grouping : e.target.value ,total : "1", currentPage : "1", pageSize : "5"};
POJO
public class PaginationRequest {
private String grouping;
private String total;
private String currentPage;
private String pageSize;
//setter/getter
}