I have upgraded from Spring Boot 2.1.11.RELEASE
to 2.2.5.RELEASE
. Previously passing invalid JSON to a MVC controller - e.g. {"truncated
- would return a 400 status code. Now Spring Boot is returning a 500 status code with the message:
{
"httpStatus":"INTERNAL_SERVER_ERROR",
"message":"The server was unable to respond to your request, an unexpected error has occurred.",
"errors":[
"JSON conversion problem: Unexpected end-of-input in VALUE_STRING; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Unexpected end-of-input in VALUE_STRING\n at [Source: (PushbackInputStream); line: 1, column: 42] (through reference chain: com.example.dto.ExampleDTO[\"comment\"])"
]
}
Doesn't seem very RESTful to return a 5xx when the client has made the error.
Comment From: wilkinsona
Duplicates #20591.