diff --git a/openapi_core/unmarshalling/response/unmarshallers.py b/openapi_core/unmarshalling/response/unmarshallers.py index ce88a753..780c2c71 100644 --- a/openapi_core/unmarshalling/response/unmarshallers.py +++ b/openapi_core/unmarshalling/response/unmarshallers.py @@ -63,9 +63,12 @@ def _unmarshal( except ResponseFinderError as exc: return ResponseUnmarshalResult(errors=[exc]) + # Drop optional "; charset=utf-8" + mimetype = response.mimetype.split(';')[0] + try: validated_data = self._get_data( - response.data, response.mimetype, operation_response + response.data, mimetype, operation_response ) except DataValidationError as exc: validated_data = None @@ -103,9 +106,12 @@ def _unmarshal_data( except ResponseFinderError as exc: return ResponseUnmarshalResult(errors=[exc]) + # Drop optional "; charset=utf-8" + mimetype = response.mimetype.split(';')[0] + try: validated = self._get_data( - response.data, response.mimetype, operation_response + response.data, mimetype, operation_response ) except DataValidationError as exc: validated = None