Skip to content

Commit a861bf2

Browse files
committed
feat: enhance JSON deserialization to handle non-string input for arrays
1 parent 7839bdc commit a861bf2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

clients/algoliasearch-client-python/algoliasearch/http/api_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def deserialize(klass: Any = None, data: Any = None) -> Any:
6565

6666
if hasattr(klass, "__origin__") and klass.__origin__ is list:
6767
sub_kls = klass.__args__[0]
68-
arr = json.loads(data)
68+
arr = json.loads(data) if isinstance(data, str) else data
6969
return [ApiResponse.deserialize(sub_kls, sub_data) for sub_data in arr]
7070

7171
if hasattr(klass, "__origin__") and klass.__origin__ is dict:

0 commit comments

Comments
 (0)