From 9d189e18cc5f5adfddc34c8be6815a0e0589370b Mon Sep 17 00:00:00 2001 From: p1c2u Date: Wed, 20 Sep 2023 15:00:11 +0000 Subject: [PATCH] aiohttp response body check none fix --- openapi_core/contrib/aiohttp/responses.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openapi_core/contrib/aiohttp/responses.py b/openapi_core/contrib/aiohttp/responses.py index 547ebe62..40771e2f 100644 --- a/openapi_core/contrib/aiohttp/responses.py +++ b/openapi_core/contrib/aiohttp/responses.py @@ -14,6 +14,8 @@ def __init__(self, response: web.Response): @property def data(self) -> str: + if self.response.body is None: + return "" if isinstance(self.response.body, bytes): return self.response.body.decode("utf-8") assert isinstance(self.response.body, str)