1
0
Fork 0
forked from sr2/cloud-api

feat: fully defined response code descriptions

Only done on three endpoints. This is a lot of repeated text.
This commit is contained in:
Chris Milne 2026-06-11 16:02:51 +01:00
parent c2e035dede
commit 5d122a7690
4 changed files with 109 additions and 5 deletions

View file

@ -46,7 +46,28 @@ router = APIRouter(
response_model=ServiceGetServiceResponse,
responses={
status.HTTP_200_OK: {"description": "Successful retrieval from database"},
status.HTTP_401_UNAUTHORIZED: {"description": "Unauthorized"},
status.HTTP_401_UNAUTHORIZED: {
"description": "Unauthorized",
"content": {
"application/json": {
"examples": {
"awaiting_approval": {
"summary": "Organisation has not yet been approved."
},
}
}
},
},
status.HTTP_403_FORBIDDEN: {
"description": "Forbidden",
"content": {
"application/json": {
"examples": {
"not_root": {"summary": "Not authorised. Must be root user."},
}
}
},
},
},
)
async def get_all_services(