@@ -317,11 +317,11 @@ def set_json_key(self, json_object, key, value):
317317 "reason" : "Item is valid JSON, but can't handle lists. Use .#"
318318 }
319319
320- if not isinstance (json_object , object ):
321- return {
322- "success" : False ,
323- "reason" : "Item is not valid JSON (2)"
324- }
320+ # if not isinstance(json_object, object):
321+ # return {
322+ # "success": False,
323+ # "reason": "Item is not valid JSON (2)"
324+ # }
325325
326326
327327 if isinstance (value , str ):
@@ -404,7 +404,7 @@ def replace_value(self, input_data, translate_from, translate_to, else_value="")
404404 return input_data
405405
406406 def replace_value_from_dictionary (self , input_data , mapping , default_value = "" ):
407- if not isinstance (mapping , dict ) and not isinstance ( mapping , object ):
407+ if isinstance (mapping , str ):
408408 try :
409409 mapping = json .loads (mapping )
410410 except json .decoder .JSONDecodeError as e :
@@ -1419,14 +1419,15 @@ def merge_lists(self, list_one, list_two, set_field="", sort_key_list_one="", so
14191419 return list_one
14201420
14211421 def xml_json_convertor (self , convertto , data ):
1422- if isinstance (data , dict ) or isinstance (data , object ) or isinstance ( data , list ):
1422+ if isinstance (data , dict ) or isinstance (data , list ):
14231423 try :
14241424 data = json .dumps (data )
14251425 except :
14261426 pass
14271427
14281428 try :
14291429 if convertto == "json" :
1430+ data = data .replace (" encoding=\" utf-8\" " , " " )
14301431 ans = xmltodict .parse (data )
14311432 json_data = json .dumps (ans )
14321433 return json_data
@@ -1448,7 +1449,7 @@ def date_to_epoch(self, input_data, date_field, date_format):
14481449 )
14491450 )
14501451
1451- if not isinstance (input_data , dict ) and not isinstance ( input_data , object ):
1452+ if isinstance (input_data , str ):
14521453 result = json .loads (input_data )
14531454 else :
14541455 result = input_data
@@ -1573,7 +1574,7 @@ def check_cache_contains(self, key, value, append):
15731574 "key" : key ,
15741575 }
15751576
1576- if isinstance (value , dict ) or isinstance (value , list ) or isinstance ( value , object ) :
1577+ if isinstance (value , dict ) or isinstance (value , list ):
15771578 try :
15781579 value = json .dumps (value )
15791580 except Exception as e :
@@ -1767,7 +1768,7 @@ def set_cache_value(self, key, value):
17671768 org_id = self .full_execution ["workflow" ]["execution_org" ]["id" ]
17681769 url = "%s/api/v1/orgs/%s/set_cache" % (self .url , org_id )
17691770
1770- if isinstance (value , dict ) or isinstance (value , list ) or isinstance ( value , object ) :
1771+ if isinstance (value , dict ) or isinstance (value , list ):
17711772 try :
17721773 value = json .dumps (value )
17731774 except Exception as e :
0 commit comments