Skip to content

Commit 425db35

Browse files
committed
@GitHK review: rm note and example
1 parent f0ec116 commit 425db35

File tree

2 files changed

+6
-3
lines changed
  • services/api-server/src/simcore_service_api_server

2 files changed

+6
-3
lines changed

services/api-server/src/simcore_service_api_server/exceptions/handlers/_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ def create_error_json_response(
1818
Converts errors to Error response model defined in the OAS
1919
"""
2020

21-
# NOTE: do not forget to add in the decorator `responses={ ???: {"model": ErrorGet} }`
22-
# SEE https://fastapi.tiangolo.com/advanced/additional-responses/#additional-response-with-model
2321
error_model = ErrorGet(errors=list(errors))
2422
return JSONResponse(
2523
content=jsonable_encoder(error_model),

services/api-server/src/simcore_service_api_server/models/schemas/errors.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any
1+
from typing import Any, ClassVar
22

33
from pydantic import BaseModel
44

@@ -10,3 +10,8 @@ class ErrorGet(BaseModel):
1010
# - https://github.com/ITISFoundation/osparc-simcore/issues/2520
1111
# - https://github.com/ITISFoundation/osparc-simcore/issues/2446
1212
errors: list[Any]
13+
14+
class Config:
15+
schema_extra: ClassVar[dict[str, Any]] = {
16+
"example": ["some error message", "another error message"]
17+
}

0 commit comments

Comments
 (0)