I'm using Spring Boot 3, and from what I understand, it should support the RFC 7807, aka "Problem Details", out of the box. However, I cannot figure out how to enable Spring Boot (web) to return errors in this format. By default, it seems to return it in the standard Spring JSON format:
{
"timestamp": "2012-04-25T10:56:28.294 0000",
"path": "/api/v1/some-resource",
"status": 400,
"error": "Bad Request",
"exception": "java.lang.IllegalArgumentException"
}
How do I enable "Problem Details" (RFC 7807) in Spring Boot 3?
CodePudding user response:
It seems to be (common spring-boot application property):
spring.mvc.problemdetails.enabled
Whether RFC 7807 Problem Details support should be enabled.
(defaults to) false
Please test/report issues;)