From 1fad7406068d43ca277f3cb1feda773af0920fc1 Mon Sep 17 00:00:00 2001 From: Edwin van den Houdt Date: Thu, 27 Aug 2026 14:21:26 +0200 Subject: [PATCH] fix(api): regenerate client for RB-08's 403 response shape RB-08 changed DELETE /admin/uploads/{documentId}'s 403 mapping from .Produces to .ProducesProblem, matching CasesAdmin's actual Results.Problem() response - but the generated OpenAPI doc and typed client were never regenerated alongside it, so CI's api-client-drift check (npm run gen:api && git diff --exit-code) was left red. No frontend consumes this admin-only endpoint (confirmed by grep), so this is a pure regeneration with no consumer impact. Co-Authored-By: Claude Opus 5 --- backend/swagger.json | 9 ++++++++- libs/shared/src/infrastructure/api-client.ts | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/backend/swagger.json b/backend/swagger.json index af86f93..dbad12d 100644 --- a/backend/swagger.json +++ b/backend/swagger.json @@ -400,7 +400,14 @@ "description": "No Content" }, "403": { - "description": "Forbidden" + "description": "Forbidden", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } }, "404": { "description": "Not Found" diff --git a/libs/shared/src/infrastructure/api-client.ts b/libs/shared/src/infrastructure/api-client.ts index 05eb07b..3d4da57 100644 --- a/libs/shared/src/infrastructure/api-client.ts +++ b/libs/shared/src/infrastructure/api-client.ts @@ -612,7 +612,9 @@ export class ApiClient { }); } else if (status === 403) { return response.text().then((_responseText) => { - return throwException("Forbidden", status, _responseText, _headers); + let result403: any = null; + result403 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ProblemDetails; + return throwException("Forbidden", status, _responseText, _headers, result403); }); } else if (status === 404) { return response.text().then((_responseText) => {