From 31b1c4c1901fb5eccaf9a4eccf4e5557aefffdfc Mon Sep 17 00:00:00 2001 From: Lyncoln Date: Mon, 26 Oct 2026 09:25:14 -0400 Subject: [PATCH] Introduced buildObject2 to handle recursive object building --- core/apirequest/object.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/core/apirequest/object.py b/core/apirequest/object.py index ce8b38d..b7b10ba 100644 --- a/core/apirequest/object.py +++ b/core/apirequest/object.py @@ -9,3 +9,27 @@ def buildObject(keys, outputs, resolved): ) return object + + +def buildObject2(value, outputs, resolved): + + if isinstance(value, dict): + + if value.keys() == {"resolved"}: + return resolved[value["resolved"]] + + if value.keys() == {"output"}: + return outputs[value["output"]] + + return { + key: buildObject2(item, outputs, resolved) + for key, item in value.items() + } + + if isinstance(value, list): + return [ + buildObject2(item, outputs, resolved) + for item in value + ] + + return value \ No newline at end of file