def decode_json()

in scripts/saved_object_decoder/so_decoder.py [0:0]


def decode_json(saved_obj, to_decode):
    for key, val in to_decode.items():
        if key not in saved_obj:
            continue
        for field in val:
            if isinstance(field, dict):
                decode_json(saved_obj[key], field)
            elif isinstance(field, str) and field in saved_obj[key]:
                saved_obj[key][field] = json.loads(saved_obj[key][field])

    return saved_obj