-
Notifications
You must be signed in to change notification settings - Fork 0
docs: document RFC 9457 dual response formats in OpenAPI schema #494
Copy link
Copy link
Closed
Labels
prio:mediumShould do, but not blockingShould do, but not blockingscope:smallLess than 1 day of workLess than 1 day of worktype:docsDocumentation workDocumentation work
Description
Summary
The OpenAPI schema does not document the application/problem+json response format introduced in #464. Clients relying on the OpenAPI spec to discover the content negotiation feature will not know it exists.
Context
PR #464 (RFC 9457 Phase 2) added content negotiation: clients sending Accept: application/problem+json receive bare RFC 9457 ProblemDetail responses instead of the ApiResponse envelope. However, the OpenAPI schema generation (scripts/export_openapi.py) was not updated to reflect this, since content negotiation happens in exception handlers (not in controller return types) and Litestar's auto-generation does not discover it.
Scope
- Add
ProblemDetailas an alternative error response schema in the OpenAPI spec - Document the
Accept: application/problem+jsoncontent negotiation behavior - This likely requires Litestar app-level
responsesconfiguration or custom OpenAPI schema hooks - Update
scripts/export_openapi.pyif needed
Acceptance Criteria
- OpenAPI schema includes
ProblemDetailschema definition - Error responses document both
application/json(envelope) andapplication/problem+json(bare) content types - Generated API reference page (Scalar UI) shows both response formats
Dependencies
- feat: implement RFC 9457 Phase 2 — application/problem+json and content negotiation #464 (RFC 9457 Phase 2 — done)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
prio:mediumShould do, but not blockingShould do, but not blockingscope:smallLess than 1 day of workLess than 1 day of worktype:docsDocumentation workDocumentation work