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)