problem-details-rfc9457
Skill344 starsChanged 3 months agoMITView on GitHub
Use when implementing exception mapping or RFC 9457 error responses in Spring Boot 4. Preserve an existing legacy error contract unless migration is requested.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- fatonh/symfony-skillstheir own version, first seen Jun 20, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- fatonh/symfony-skills★ 35same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository77 other files it gives its agents.
- agent-qa-browser-regressionSkill
- ai-observabilitySkill
- api-versioningSkill
- configuration-propertiesSkill
- container-native-deploymentSkill
- domain-driven-designSkill
- event-driven-messagingSkill
- flyway-migrationsSkill
- hateoasSkill
- hexagonal-architectureSkill
- http-interface-clientsSkill
- idempotency-patternsSkill
- java-supply-chain-securitySkill
- layered-architectureSkill
- mcp-serverSkill
- multi-module-mavenSkill
- multi-tenancySkill
- null-safetySkill
- oauth2-resource-serverSkill
- openapi-firstSkill
- problem-details-rfc9457Skill
- production-observabilitySkill
- resilience-retrySkill
- rest-api-conventionsSkill
- security-audit-loggingSkill
- spring-ai-integrationSkill
- spring-ai-securitySkill
- spring-batchSkill
- spring-boot-migrationSkill
- spring-cloud-gatewaySkill
- spring-data-jpaSkill
- spring-data-redisSkill
- spring-incident-responseSkill
- spring-modulithSkill
- spring-security-jwtSkill
- spring-security-reviewSkill
- testing-pyramidSkill
- transactional-patternsSkill
- webflux-reactive-patternsSkill
- agent-qa-browser-regressionSkill
- ai-observabilitySkill
- api-versioningSkill
- configuration-propertiesSkill
- container-native-deploymentSkill
- domain-driven-designSkill
- event-driven-messagingSkill
- flyway-migrationsSkill
- hateoasSkill
- hexagonal-architectureSkill
- http-interface-clientsSkill
- idempotency-patternsSkill
- java-supply-chain-securitySkill
- layered-architectureSkill
- mcp-serverSkill
- multi-module-mavenSkill
- multi-tenancySkill
- null-safetySkill
- oauth2-resource-serverSkill
- openapi-firstSkill
- production-observabilitySkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Use the compiled DomainException together with ProblemDetailExceptionHandler.
- Distinctive: line 40
Do not expose arbitrary persistence or infrastructure exception messages.
- Very specific: line 63
Use project-owned, stable URIs for custom problem types.
- Very specific: line 66
Use extensions such as errorCode or violations for machine-readable details instead of requiring clients to parse human-readable messages.
- Distinctive: line 71
Test actual HTTP responses for domain 404/422, validation 400, unexpected 500, and framework errors such as malformed JSON and unsupported …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Problem Details - RFC 9457
Choose the error contract
Inspect existing advice, security entry points and API tests first. Keep one error policy per API. Success DTOs or success envelopes can coexist with Problem Details errors: RFC 9457 specifies errors, not success representations.
For an API using Problem Details, enable Spring's built-in MVC exception handling:
spring:
mvc:
problemdetails:
enabled: trueFor WebFlux use spring.webflux.problemdetails.enabled and reactive exception handling;
the servlet templates below are not WebFlux handlers.
Domain errors
Use the compiled DomainException together with ProblemDetailExceptionHandler. The handler maps all subclasses using their declared status and stable error code:
- OrderNotFoundException: 404.
- InsufficientInventoryException: 422.
- BusinessRuleViolationException: 422.
Each public class has its own file. These are API-facing exceptions with HTTP status metadata; for a framework-free domain, keep domain exceptions independent and map them in the web adapter. Do not expose arbitrary persistence or infrastructure exception messages.
The advice extends ResponseEntityExceptionHandler to preserve Spring's handling of framework
exceptions. Validation returns 400 with field violations; unexpected failures return a generic
500 while retaining the full exception only in server logs. Keep nullable validation messages safe.
Filter-level authentication failures need an AuthenticationEntryPoint; authorization failures
need an AccessDeniedHandler. Controller advice does not cover the security filter chain.
Method-security (@PreAuthorize) denials are the opposite case: AccessDeniedException is thrown
inside the dispatcher, so the advice must map it to 403 or the Exception catch-all returns 500.
Response fields
{
"type": "https://api.example.com/errors/order_not_found",
"title": "Not Found",
"status": 404,
"detail": "Order not found",
"instance": "/api/orders/123",
"errorCode": "ORDER_NOT_FOUND"
}Use project-owned, stable URIs for custom problem types. An explicit type is optional;
when omitted it defaults to about:blank. Its title should then match the HTTP status phrase.
The HTTP status and the body status must agree. Use application/problem+json for JSON problems.
Use extensions such as errorCode or violations for machine-readable details instead of
requiring clients to parse human-readable messages.
Verification
Test actual HTTP responses for domain 404/422, validation 400, unexpected 500, and framework errors such as malformed JSON and unsupported methods. Assert content type, status, stable error codes and absence of stack traces or internal messages. Separately test filter 401/403. The repository verification fixture imports these exact templates for both Boot versions.
Official sources
Gotchas
- Agent handles a different exception class than the domain throws - test the concrete exceptions.
- Agent forces Problem Details into an existing legacy API - preserve its contract unless asked to migrate.
- Agent requires an explicit type for every error - about:blank is the default.
- Agent treats success envelopes and Problem Details as incompatible - only error policy must be consistent.
- Agent relies on advice for filter exceptions - configure the security handlers separately.
- Agent returns internal exception messages in 500 responses - log privately and return generic detail.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

