import json


def is_json_file(filepath):
    """
    Detects if a string is a valid json or not
    """
    try:
        with open(filepath) as file:
            json.load(file)
    except Exception:
        return False
    return True