diff --git a/backend/app_sdk/app_base.py b/backend/app_sdk/app_base.py index a8ec11be..c64939ce 100755 --- a/backend/app_sdk/app_base.py +++ b/backend/app_sdk/app_base.py @@ -584,6 +584,15 @@ class AppBase: return newoutput except: pass + + # Dont return json properly unless actually json + if inputtype == "json": + try: + json.loads(newoutput) + return newoutput + except: + # Returns original if json fixing didn't work + return liquiddata return newoutput diff --git a/backend/app_sdk/autocorrect_test.py b/backend/app_sdk/autocorrect_test.py index d8c5dbbc..a7624c76 100644 --- a/backend/app_sdk/autocorrect_test.py +++ b/backend/app_sdk/autocorrect_test.py @@ -135,6 +135,15 @@ def patternfix_string(liquiddata, patterns, regex_patterns, inputtype="liquid"): except: pass + # Dont return json properly unless actually json + if inputtype == "json": + try: + json.loads(newoutput) + return newoutput + except: + # Returns original if json fixing didn't work + return liquiddata + return newoutput print("Start:\n%s" % input_data)