From 051be4df1007c72d2870f76b47c8ac0856d282cc Mon Sep 17 00:00:00 2001 From: Fabrice Hong Date: Wed, 5 Apr 2023 20:18:06 +0200 Subject: [PATCH] fix(json_parser): fixing the "TypeError('the JSON object must be str, bytes or bytearray, not dict')" after a json_fix is successful --- scripts/json_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/json_parser.py b/scripts/json_parser.py index 11ff9ed2..763a4789 100644 --- a/scripts/json_parser.py +++ b/scripts/json_parser.py @@ -67,7 +67,8 @@ def fix_json(json_str: str, schema: str, debug=False) -> str: print(f"Fixed JSON: {result_string}") print("----------- END OF FIX ATTEMPT ----------------") try: - return json.loads(result_string) + json.loads(result_string) # just check the validity + return result_string except: # Get the call stack: # import traceback