Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
openapi: Remove unnecessary cast.
Anders Kaseorgc8784634e1d4
diff --git a/zerver/openapi/openapi.py b/zerver/openapi/openapi.pyindex eab09e1e275..5cd56cf13be 100644--- a/zerver/openapi/openapi.py+++ b/zerver/openapi/openapi.py@@ -8,12 +8,11 @@import jsonimport osimport re-from typing import Any, Dict, List, Mapping, Optional, Set, Tuple, Union, cast+from typing import Any, Dict, List, Mapping, Optional, Set, Tuple, Unionimport openapi_coreimport orjsonfrom openapi_core import Spec-from openapi_core.protocols import Responsefrom openapi_core.testing import MockRequest, MockResponsefrom openapi_core.validation.exceptions import ValidationError as OpenAPIValidationError@@ -395,9 +394,7 @@ def validate_against_openapi_schema(status_code=int(status_code),)try:- openapi_core.validate_response(- mock_request, cast(Response, mock_response), spec=openapi_spec.spec()- )+ openapi_core.validate_response(mock_request, mock_response, spec=openapi_spec.spec())except OpenAPIValidationError as error:message = f"Response validation error at {method} /api/v1{path} ({status_code}):"message += f"\n\n{type(error).__name__}: {error}"