From 8af4d691ed35cb61050851d53218bcf8e7b72072 Mon Sep 17 00:00:00 2001 From: GovFvck Date: Tue, 22 Oct 2024 13:26:31 +0330 Subject: [PATCH 1/2] Doc: 404 response for 'modify_admin' --- app/routers/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routers/admin.py b/app/routers/admin.py index 5d37bc33e..63ecfd184 100644 --- a/app/routers/admin.py +++ b/app/routers/admin.py @@ -71,7 +71,7 @@ def create_admin( @router.put( "/admin/{username}", response_model=Admin, - responses={403: responses._403}, + responses={403: responses._403, 404: responses._404}, ) def modify_admin( modified_admin: AdminModify, From be725c7da1695743f41708e48f1818b9164022fc Mon Sep 17 00:00:00 2001 From: GovFvck Date: Tue, 22 Oct 2024 13:34:10 +0330 Subject: [PATCH 2/2] Doc: fix descripton naming for extra responses --- app/utils/responses.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/utils/responses.py b/app/utils/responses.py index 58669266c..0a733729b 100644 --- a/app/utils/responses.py +++ b/app/utils/responses.py @@ -23,10 +23,10 @@ class Conflict(HTTPException): detail: str = "'Entity' already exists" -_400 = {"description": "Bad request", "model": HTTPException} +_400 = {"description": "BadRequest Error", "model": HTTPException} _401 = { - "description": "Unauthorized", + "description": "Unauthorized Error", "model": Unauthorized, "headers": { "WWW-Authenticate": { @@ -36,8 +36,8 @@ class Conflict(HTTPException): }, } -_403 = {"description": "Forbidden", "model": Forbidden} +_403 = {"description": "Forbidden Error", "model": Forbidden} -_404 = {"description": "Not found", "model": NotFound} +_404 = {"description": "NotFound Error", "model": NotFound} -_409 = {"description": "Conflict", "model": Conflict} +_409 = {"description": "Conflict Error", "model": Conflict}