From 678e3f9c93cfb8a72b54cd99f9b352538ee20b49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Fri, 5 Aug 2022 14:10:25 +0200 Subject: [PATCH] feat: add new standard errors (#1890) * feat: add new standard errors for 404 and 409 Co-authored-by: Thomas Heartman --- src/lib/openapi/util/standard-responses.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib/openapi/util/standard-responses.ts b/src/lib/openapi/util/standard-responses.ts index c206249215..2abba82af7 100644 --- a/src/lib/openapi/util/standard-responses.ts +++ b/src/lib/openapi/util/standard-responses.ts @@ -11,9 +11,20 @@ const badRequestResponse = { description: 'The request data does not match what we expect.', } as const; +const notFoundResponse = { + description: 'The requested resource was not found.', +} as const; + +const conflictResponse = { + description: + 'The provided resource can not be created or updated because it would conflict with the current state of the resource or with an already existing resource, respectively.', +} as const; + const standardResponses = { 400: badRequestResponse, 401: unauthorizedResponse, + 404: notFoundResponse, + 409: conflictResponse, } as const; type StandardResponses = typeof standardResponses;