From 2eff58bd71aab7589192475d561499b71afa7f37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Tue, 23 Aug 2022 13:34:16 +0200 Subject: [PATCH] docs: add 403 standard error (#1927) --- src/lib/openapi/util/standard-responses.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/openapi/util/standard-responses.ts b/src/lib/openapi/util/standard-responses.ts index 26082e8e0c..0b6534a6b7 100644 --- a/src/lib/openapi/util/standard-responses.ts +++ b/src/lib/openapi/util/standard-responses.ts @@ -7,6 +7,11 @@ const unauthorizedResponse = { 'Authorization information is missing or invalid. Provide a valid API token as the `authorization` header, e.g. `authorization:*.*.my-admin-token`.', } as const; +const forbiddenResponse = { + description: + 'User credentials are valid but does not have enough privileges to execute this operation', +} as const; + const badRequestResponse = { description: 'The request data does not match what we expect.', } as const; @@ -23,6 +28,7 @@ const conflictResponse = { const standardResponses = { 400: badRequestResponse, 401: unauthorizedResponse, + 403: forbiddenResponse, 404: notFoundResponse, 409: conflictResponse, } as const;