problem-details-rfc9457

Featured

Use when implementing error handling, exception mappers, or error response formatting. Enforces RFC 9457 (Problem Details for HTTP APIs) using Spring's built-in ProblemDetail.

AI & Automation 288 stars 44 forks Updated 5 days ago MIT

Install

View on GitHub

Quality Score: 88/100

Stars 20%
82
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Problem Details — RFC 9457 Spring Boot 4.x includes native RFC 9457 support via `ProblemDetail` on Spring Framework 7. ## Enable in application.yml ```yaml spring: mvc: problemdetails: enabled: true # enables Spring's built-in RFC 9457 handler ``` ## ProblemDetail Response Shape ```json { "type": "https://api.example.com/errors/order-not-found", "title": "Order Not Found", "status": 404, "detail": "No order found with id: 550e8400-e29b-41d4-a716-446655440000", "instance": "/api/v1/orders/550e8400-e29b-41d4-a716-446655440000", "errorCode": "ORDER_NOT_FOUND", "timestamp": "2026-04-13T10:00:00Z" } ``` ## Global Exception Handler ```java @RestControllerAdvice public class GlobalExceptionHandler extends ResponseEntityExceptionHandler { @ExceptionHandler(EntityNotFoundException.class) public ProblemDetail handleNotFound(EntityNotFoundException ex, HttpServletRequest request) { ProblemDetail problem = ProblemDetail.forStatusAndDetail(HttpStatus.NOT_FOUND, ex.getMessage()); problem.setType(URI.create("https://api.example.com/errors/not-found")); problem.setTitle("Resource Not Found"); problem.setInstance(URI.create(request.getRequestURI())); problem.setProperty("errorCode", "NOT_FOUND"); problem.setProperty("timestamp", Instant.now()); return problem; } @ExceptionHandler(BusinessRuleViolationException.class) public ProblemDetail handleBusinessRule(BusinessRuleViolationExc...

Details

Author
rrezartprebreza
Repository
rrezartprebreza/spring-boot-skills
Created
5 months ago
Last Updated
5 days ago
Language
Java
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

problem-details-error-design

Playbook for designing a consistent RFC 9457 Problem Details error model — type URIs, extension members, status code mapping, and a catalog template. Prevents per-endpoint bespoke error shapes.

7 Updated yesterday
mcorbett51090
Code & Development Listed

error-envelope

This skill should be used when the user mentions "error handling", "problem details", "rfc 9457", "rfc 7807", "request validation", "api errors", "zod", "pydantic", "class-validator", "error response format", "problem+json", "validation error", or making an API return consistent, machine-readable errors. It provides the RFC 9457 Problem Details envelope and idiomatic per-stack request-validation patterns.

3 Updated 2 days ago
ClaudeRegistry
API & Backend Listed

controller-advice-style

The house style for error responses of a Spring MVC REST application - `@RestControllerAdvice`, `@ExceptionHandler`, `ProblemDetail` (RFC 9457), `ResponseEntityExceptionHandler`, `AuthenticationEntryPoint`, `AccessDeniedHandler`. Load it before writing or changing any of them, when a new exception has to reach the client, when shaping validation `errors`, and when an endpoint returns 403 where 401 was expected, a `@PreAuthorize` denial comes back as 500, a status is lost to a catch-all handler, one module's exception is answered by another module's advice, or an error body has its fields nested under `properties`. Not for the controllers themselves (the separate `controller-style` skill) and not for documenting errors in Swagger (the separate `swagger-style` skill).

0 Updated 2 days ago
dmitriy-iliyov