feat: fully defined response code descriptions
Only done on three endpoints. This is a lot of repeated text.
This commit is contained in:
parent
c2e035dede
commit
5d122a7690
4 changed files with 109 additions and 5 deletions
|
|
@ -58,7 +58,7 @@ def get_org_model_body(
|
|||
) -> type[Org]:
|
||||
org_id: Optional[int] = getattr(request_model, "organisation_id", None)
|
||||
if org_id is None:
|
||||
raise OrgNotFoundException
|
||||
raise OrgNotFoundException()
|
||||
|
||||
return get_org_model(db, request, org_id)
|
||||
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue