From 8c9de2a902c5c7e7e960f70f6175a72741893716 Mon Sep 17 00:00:00 2001 From: Evgeniy Ryabtsev Date: Mon, 1 Jul 2024 00:29:18 +0300 Subject: [PATCH] Validation crashes on BooleanCaster: AttributeError: 'int' object has no attribute 'lower' --- openapi_core/casting/schemas/casters.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openapi_core/casting/schemas/casters.py b/openapi_core/casting/schemas/casters.py index 94df492b..55022dc7 100644 --- a/openapi_core/casting/schemas/casters.py +++ b/openapi_core/casting/schemas/casters.py @@ -74,7 +74,10 @@ def validate(self, value: Any) -> None: if isinstance(value, bool): return - if value.lower() not in ["false", "true"]: + if ( + not isinstance(value, (str, bytes)) or + value.lower() not in ["false", "true"] + ): raise ValueError("not a boolean format") pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy