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

@ -387,7 +387,29 @@ async def delete_organisation_by_id(
"description": "Successfully deleted organisation."
},
status.HTTP_422_UNPROCESSABLE_CONTENT: {
"description": "Org ID missing or invalid."
"description": "Unprocessable content.",
"content": {
"application/json": {
"examples": {
"org_id": {"summary": "Invalid or missing org ID."},
"oidc_claims": {"summary": "Invalid or missing OIDC claims."},
}
}
},
},
status.HTTP_401_UNAUTHORIZED: {
"description": "Unauthorized",
"content": {
"application/json": {
"examples": {
"awaiting_approval": {
"summary": "Organisation has not yet been approved."
},
"expired_token": {"summary": "User token has expired."},
"oidc": {"summary": "Failed to verify OIDC claims."},
}
}
},
},
status.HTTP_403_FORBIDDEN: {
"description": "Forbidden",
@ -402,6 +424,20 @@ async def delete_organisation_by_id(
}
},
},
status.HTTP_404_NOT_FOUND: {
"description": "Not found",
"content": {
"application/json": {
"examples": {
"db_id": {
"summary": "User not found in db when checking claims."
},
"user_model": {"summary": "User model not found in db."},
"org_model": {"summary": "Org model not found in db."},
}
}
},
},
},
)
async def delete_preapproved_organisation_by_id(