79351370

Date: 2025-01-13 06:59:12
Score: 1
Natty:
Report link

In my case, i was expecting a success status and message from defined DTO from controller response for a POST /create API call. Just by adding the @JsonProperty over the DTO properties the problem is sorted.

public class ResponseDto {
    @JsonProperty("StatusCode")
    private String statusCode;
    @JsonProperty("StatusMessage")
    private String statusMessage;
    public ResponseDto(String statusCode, String statusMessage) {
      this.statusCode = statusCode;
      this.statusMessage = statusMessage;
    }
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @JsonProperty
  • Low reputation (1):
Posted by: Ravindra B