You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
spp_api_v2: error responses are FastAPI {detail}, not the RFC 9457 Problem Details the API principles specify #556
OpenSPP's API guidelines specify RFC 9457 Problem Details (type, title, status, detail, application/problem+json), and spp_api_v2/schemas/problem_detail.py defines a ProblemDetail schema. But no spp_api_v2* module registers an exception handler: routers raise HTTPException, and the OCA fastapi error path
(fastapi/error_handlers.py, convert_exception_to_status_body) renders {"detail": ...} as application/json.
The principle doc already carries a note that "a global exception handler should be added".
Clients (e.g. the OpenFn language-openspp v4 adaptor) currently have to parse both shapes. #434 (spp_attendance
alignment) assumes the v2 stack already emits RFC 9457.
Proposal
Render ProblemDetail (application/problem+json, URN type per the principle's category table) for all spp_api_v2 endpoints, including bundle per-entry errors and 422 validation errors (errors[]). This changes every
error body, so it needs a release note and ideally a deprecation window (e.g. keep detail populated, which RFC 9457
allows).
Context
Item C of #554 (deferred from PR #555 as a contract change).
Activity