Skip to content

Commit ac2d7bf

Browse files
committed
enhanced route signature parameters computation
1 parent fd4fe3c commit ac2d7bf

File tree

6 files changed

+437
-193
lines changed

6 files changed

+437
-193
lines changed

ellar/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
APP_MODULE_KEY = "APP_MODULE_KEY"
4040
TEMPLATE_GLOBAL_KEY = "__TEMPLATE_GLOBAL_KEY__"
4141
TEMPLATE_FILTER_KEY = "__TEMPLATE_FILTER_KEY__"
42+
OPENAPI_NECESSARY = "OPENAPI_NECESSARY"
43+
MULTI_RESOLVER_KEY = "MULTI_RESOLVER_KEY"
4244

4345
sequence_shapes = {
4446
SHAPE_LIST,

ellar/core/exception_handlers.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from ellar.core.connection import Request
66
from ellar.core.response import JSONResponse
77
from ellar.exceptions import APIException, RequestValidationError
8+
from ellar.serializer import serialize_object
89

910

1011
async def api_exception_handler(request: Request, exc: APIException) -> JSONResponse:
@@ -16,7 +17,9 @@ async def api_exception_handler(request: Request, exc: APIException) -> JSONResp
1617
data = exc.detail
1718
else:
1819
data = {"detail": exc.detail}
19-
return json_response_type(data, status_code=exc.status_code, headers=headers)
20+
return json_response_type(
21+
serialize_object(data), status_code=exc.status_code, headers=headers
22+
)
2023

2124

2225
async def request_validation_exception_handler(
@@ -27,5 +30,5 @@ async def request_validation_exception_handler(
2730

2831
return json_response_type(
2932
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
30-
content={"detail": exc.errors()},
33+
content={"detail": serialize_object(exc.errors())},
3134
)

0 commit comments

Comments
 (0)