From c1dcc6925d5b4aaa0afdd0b8cbfeacb7572c0a1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20G=C3=B3rski?= <33100242+tehAgitto@users.noreply.github.com> Date: Thu, 13 Apr 2023 11:35:21 +0200 Subject: [PATCH] [Fix] json as list (#215) --- pyproject.toml | 2 +- vmngclient/response.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 410f7fdd5..0154b824f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "vmngclient" -version = "0.8.1" +version = "0.8.2" description = "Universal vManage API" authors = ["kagorski "] readme = "README.md" diff --git a/vmngclient/response.py b/vmngclient/response.py index 7376a0674..9d9aac147 100644 --- a/vmngclient/response.py +++ b/vmngclient/response.py @@ -58,7 +58,10 @@ def response_debug(response: Optional[Response], request: Union[Request, Prepare } try: json = response.json() - json.pop("header", None) + + if isinstance(json, dict): + json.pop("header", None) + response_debug.update({"json": json}) except JSONDecodeError: if response.encoding is not None: