-
Notifications
You must be signed in to change notification settings - Fork 0
feat: implement RFC 9457 Phase 2 — application/problem+json and content negotiation #464
Copy link
Copy link
Closed
Labels
prio:mediumShould do, but not blockingShould do, but not blockingscope:medium1-3 days of work1-3 days of workspec:human-interactionDESIGN_SPEC Section 13 - Human Interaction LayerDESIGN_SPEC Section 13 - Human Interaction Layertype:featureNew feature implementationNew feature implementation
Description
Summary
Complete the RFC 9457 implementation by adding application/problem+json content type, type URI documentation links, content negotiation, and the remaining standard fields.
Phase 1 (#419, implemented in PR #457) added the core error metadata (ErrorCategory, ErrorCode, ErrorDetail, retryable, retry_after, instance). Phase 2 makes the API fully RFC 9457 compliant.
Design (from #419 Phase 2)
application/problem+jsoncontent type on error responsestypeURI field linking to error documentation (e.g.https://synthorg.io/docs/errors/validation)- Content negotiation middleware via
Acceptheader — clients that sendAccept: application/problem+jsonget RFC 9457 format; others get the currentApiResponseenvelope titlefield — human-readable summary of the error type (static per category)detailfield — occurrence-specific human-readable explanation
Scope
- Add
titleanddetailfields toErrorDetail - Add
typeURI field (points to docs error reference) - Content negotiation:
Accept: application/problem+jsonreturns RFC 9457 format directly (not wrapped inApiResponse) - Default behavior unchanged —
ApiResponseenvelope witherror_detailfield (backward compatible) - Error documentation page at
docs/errors/listing all error codes and categories - Update OpenAPI schema to document both response formats
Dependencies
- feat: implement RFC 9457 structured error responses for API #419 Phase 1 (done, PR feat: add RFC 9457 structured error responses (Phase 1) #457)
Acceptance Criteria
- Error responses include
type,title,detailfields -
Accept: application/problem+jsonreturns RFC 9457 format directly - Default response format unchanged (backward compatible)
- Error documentation page generated/written
-
typeURIs resolve to documentation - OpenAPI schema documents both response formats
- Content negotiation tested with both Accept header values
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
prio:mediumShould do, but not blockingShould do, but not blockingscope:medium1-3 days of work1-3 days of workspec:human-interactionDESIGN_SPEC Section 13 - Human Interaction LayerDESIGN_SPEC Section 13 - Human Interaction Layertype:featureNew feature implementationNew feature implementation