Successfully built RMASS message push module, sender id resolver from DM room and included processing for 204 HTTP response with no content when handling incoming JSON

This commit is contained in:
Lyncoln
2026-10-17 00:41:52 -04:00
parent b3ac141315
commit d260d3681e
30 changed files with 211 additions and 42 deletions
+20 -18
View File
@@ -1,30 +1,32 @@
import json
def buildOutput(response, action, outputs):
#if select_data != "not applied":
#response_data = select_data
#else:
#response_data = response.json()
if hasattr(action, "outputs"):
try:
response_data = response.json()
except AttributeError:
response_data = json.loads(response)
response_objects = [response_data]
if response != None:
try:
response_data = response.json()
except AttributeError:
response_data = json.loads(response)
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
else:
return outputs
return outputs
#return outputs