From 8967d2ff697a07f9868bcf95a9470490f111d746 Mon Sep 17 00:00:00 2001 From: Keming Date: Tue, 18 Jun 2024 20:20:09 +0800 Subject: [PATCH] fix: assign the resp_validation_err (#375) Signed-off-by: Keming --- pyproject.toml | 2 +- spectree/plugins/quart_plugin.py | 1 + spectree/plugins/starlette_plugin.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 695ae695..f2f4040e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "spectree" -version = "1.2.9" +version = "1.2.10" dynamic = [] description = "generate OpenAPI document and validate request&response with Python annotations." readme = "README.md" diff --git a/spectree/plugins/quart_plugin.py b/spectree/plugins/quart_plugin.py index 910652e7..eddb3c68 100644 --- a/spectree/plugins/quart_plugin.py +++ b/spectree/plugins/quart_plugin.py @@ -236,6 +236,7 @@ async def validate( ) except ValidationError as err: response = await make_response(err.errors(), 500) + resp_validation_error = err else: response = await make_response( ( diff --git a/spectree/plugins/starlette_plugin.py b/spectree/plugins/starlette_plugin.py index 355aa992..856adf58 100644 --- a/spectree/plugins/starlette_plugin.py +++ b/spectree/plugins/starlette_plugin.py @@ -150,6 +150,7 @@ async def validate( ) except ValidationError as err: response = JSONResponse(err.errors(), 500) + resp_validation_error = err after(request, response, resp_validation_error, instance)