diff --git a/leetcode/api/default_api.py b/leetcode/api/default_api.py index d1a8e01..6b67ca9 100644 --- a/leetcode/api/default_api.py +++ b/leetcode/api/default_api.py @@ -159,7 +159,7 @@ def graphql_post(self, **kwargs): # noqa: E501 (data) = self.graphql_post_with_http_info(**kwargs) # noqa: E501 return data - def graphql_post_with_http_info(self, **kwargs): # noqa: E501 + def graphql_post_with_http_info(self, response_type: str | None = "GraphqlResponse", **kwargs): # noqa: E501 """graphql_post # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -233,7 +233,7 @@ def graphql_post_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type="GraphqlResponse", # noqa: E501 + response_type=response_type, # noqa: E501 auth_settings=auth_settings, async_req=params.get("async_req"), _return_http_data_only=params.get("_return_http_data_only"), diff --git a/leetcode/api_client.py b/leetcode/api_client.py index 5b7a8f5..882f8ff 100644 --- a/leetcode/api_client.py +++ b/leetcode/api_client.py @@ -246,6 +246,9 @@ def deserialize(self, response, response_type): except ValueError: data = response.data + if response_type == "json": + return data + return self.__deserialize(data, response_type) def __deserialize(self, data, klass):