From 6c6f5b22b4c7492dff979a02be5557c08caa0f95 Mon Sep 17 00:00:00 2001 From: Toon Willems Date: Thu, 31 Oct 2024 19:50:23 +0100 Subject: [PATCH 1/2] meta is optional in the response --- lago_python_client/services/response.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lago_python_client/services/response.py b/lago_python_client/services/response.py index cfb8e6c..1b96105 100644 --- a/lago_python_client/services/response.py +++ b/lago_python_client/services/response.py @@ -127,7 +127,7 @@ def prepare_index_response( api_resource: [ prepare_object_response(response_model=response_model, data=el) for el in response_data[api_resource] ], - "meta": response_data["meta"], + "meta": response_data.get("meta", None), } From 4aeecd1e32d4b1e615d455ca7d012e7bbc82d0ff Mon Sep 17 00:00:00 2001 From: Toon Willems Date: Thu, 31 Oct 2024 19:54:33 +0100 Subject: [PATCH 2/2] update fixture to not include meta --- tests/fixtures/overdue_balance_index.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/fixtures/overdue_balance_index.json b/tests/fixtures/overdue_balance_index.json index afcb7ed..8106dcd 100644 --- a/tests/fixtures/overdue_balance_index.json +++ b/tests/fixtures/overdue_balance_index.json @@ -12,6 +12,5 @@ "currency": "USD", "lago_invoice_ids": ["1a901a90-1a90-1a90-1a90-1a901a901a90"] } - ], - "meta": {} + ] }