Skip to content

Commit 7dc7b11

Browse files
committed
fix randomness in openapi-spec generation in webserver
1 parent b8d4d38 commit 7dc7b11

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

api/specs/web-server/_projects_states.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,35 @@
3434
)
3535

3636

37-
def to_desc(exceptions: set[type[Exception]] | type[Exception]):
38-
exc_classes = {exceptions} if not isinstance(exceptions, set) else exceptions
37+
def to_desc(exceptions: list[type[Exception]] | type[Exception]):
38+
exc_classes = [exceptions] if not isinstance(exceptions, list) else exceptions
3939
return ", ".join(f"{cls.__name__}" for cls in exc_classes)
4040

4141

4242
@router.post(
4343
"/projects/{project_id}:open",
4444
response_model=Envelope[ProjectGet],
4545
responses={
46-
status.HTTP_400_BAD_REQUEST: {"description": to_desc({ValidationError})},
46+
status.HTTP_400_BAD_REQUEST: {"description": to_desc([ValidationError])},
4747
status.HTTP_402_PAYMENT_REQUIRED: {
48-
"description": to_desc({WalletNotEnoughCreditsError})
48+
"description": to_desc([WalletNotEnoughCreditsError])
4949
},
5050
status.HTTP_403_FORBIDDEN: {
51-
"description": to_desc({ProjectInvalidRightsError})
51+
"description": to_desc([ProjectInvalidRightsError])
5252
},
5353
status.HTTP_404_NOT_FOUND: {
5454
"description": to_desc(
55-
{ProjectNotFoundError, UserDefaultWalletNotFoundError}
55+
[ProjectNotFoundError, UserDefaultWalletNotFoundError]
5656
)
5757
},
5858
status.HTTP_409_CONFLICT: {
59-
"description": to_desc({ProjectTooManyProjectOpenedError}),
59+
"description": to_desc([ProjectTooManyProjectOpenedError]),
6060
},
6161
status.HTTP_422_UNPROCESSABLE_ENTITY: {
62-
"description": to_desc({ValidationError})
62+
"description": to_desc([ValidationError])
6363
},
6464
status.HTTP_503_SERVICE_UNAVAILABLE: {
65-
"description": to_desc({DirectorServiceError})
65+
"description": to_desc([DirectorServiceError])
6666
},
6767
},
6868
)

0 commit comments

Comments
 (0)