I have below snippets
@PostMapping(path = "/failure")
public ResponseEntity<?> failure(@RequestBody RecReqPayload payload) {
try {
return ResponseEntity.ok("done");
} catch (RecommendationServiceException e) {
return ResponseEntity.badRequest().body(e.getErrorType() + " TenantID: " + e.getTenantId());
}
And POJO as(using lombok as well)
@Getter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Setter
public class RecReqPayload {
@JsonProperty("tenants")
String tenants;
@JsonProperty("ignore_job_status")
Boolean ignoreJobStatus;
}
I am executing it like below
curl --request POST
--url http://localhost:9999/failure
--header 'Content-Type: application/json'
--data '{
"tenants": "all",
"ignore_job_status":false
}'
I have spent almost over an hour on this but I am not sure what am I doing that is causing both fields to be null in the handler. The pojo fields are null