File tree 2 files changed +6
-3
lines changed
services/api-server/src/simcore_service_api_server
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,6 @@ def create_error_json_response(
18
18
Converts errors to Error response model defined in the OAS
19
19
"""
20
20
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
23
21
error_model = ErrorGet (errors = list (errors ))
24
22
return JSONResponse (
25
23
content = jsonable_encoder (error_model ),
Original file line number Diff line number Diff line change 1
- from typing import Any
1
+ from typing import Any , ClassVar
2
2
3
3
from pydantic import BaseModel
4
4
@@ -10,3 +10,8 @@ class ErrorGet(BaseModel):
10
10
# - https://github.com/ITISFoundation/osparc-simcore/issues/2520
11
11
# - https://github.com/ITISFoundation/osparc-simcore/issues/2446
12
12
errors : list [Any ]
13
+
14
+ class Config :
15
+ schema_extra : ClassVar [dict [str , Any ]] = {
16
+ "example" : ["some error message" , "another error message" ]
17
+ }
You can’t perform that action at this time.
0 commit comments