From 3dbbecdd16ec43b4f4037e336acb04a7b27bf8df Mon Sep 17 00:00:00 2001 From: tsouvarev Date: Fri, 4 Oct 2019 03:08:29 +0300 Subject: [PATCH] :bug: Fix setting 4XX overriding default 422 validation errors(#517) --- fastapi/openapi/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi/openapi/utils.py b/fastapi/openapi/utils.py index d9ec7bd6e..ee35d61fc 100644 --- a/fastapi/openapi/utils.py +++ b/fastapi/openapi/utils.py @@ -225,7 +225,7 @@ def get_openapi_path( if (all_route_params or route.body_field) and not any( [ status in operation["responses"] - for status in [http422, "4xx", "default"] + for status in [http422, "4XX", "default"] ] ): operation["responses"][http422] = {