Problem Details (RFC 7807)
Return standardized error responses.
A Standard for API Errors
Every team inventing its own error JSON leads to chaos for API consumers. RFC 7807 defines Problem Details — a standard, machine-readable error format with a media type of application/problem+json.
The Problem Details Fields
The standard defines a small set of fields:
type— a URI identifying the problem kindtitle— short, human-readable summarystatus— the HTTP status codedetail— specifics for this occurrenceinstance— URI of the specific occurrence
All lessons in this course
- Bean Validation with @Valid
- Custom Validators
- @ControllerAdvice and @ExceptionHandler
- Problem Details (RFC 7807)