Working resolver, working recursive logic with dynamic library creation
This commit is contained in:
+11
-11
@@ -3,21 +3,21 @@ def buildOutput(response, action, outputs):#, select_data):
|
||||
#response_data = select_data
|
||||
#else:
|
||||
#response_data = response.json()
|
||||
|
||||
response_data = response.json()
|
||||
response_objects = [response_data]
|
||||
if hasattr(action, "outputs"):
|
||||
response_data = response.json()
|
||||
response_objects = [response_data]
|
||||
|
||||
while response_objects:
|
||||
response_object = response_objects.pop()
|
||||
while response_objects:
|
||||
response_object = response_objects.pop()
|
||||
|
||||
for key, value, in response_object.items():
|
||||
for key, value, in response_object.items():
|
||||
|
||||
if isinstance(value, dict):
|
||||
response_objects.append(value)
|
||||
if isinstance(value, dict):
|
||||
response_objects.append(value)
|
||||
|
||||
for output_name, response_key in action.outputs.items():
|
||||
if key == response_key:
|
||||
outputs[output_name] = value
|
||||
for output_name, response_key in action.outputs.items():
|
||||
if key == response_key:
|
||||
outputs[output_name] = value
|
||||
|
||||
|
||||
return outputs
|
||||
|
||||
Reference in New Issue
Block a user