def METHOD_NAME(path: str, data: dict[str, Any]) -> None:
    expected_commonpath = os.path.realpath(DOC_FOLDER)
    doc_path = os.path.join(DOC_FOLDER, f"{path}.json")
    doc_real_path = os.path.realpath(doc_path)
    if expected_commonpath != os.path.commonpath([expected_commonpath, doc_real_path]):
        raise SuspiciousDocPathOperation("illegal path access")
    directory = os.path.dirname(doc_path)
    try:
        os.makedirs(directory)
    except OSError:
        pass
    with open(doc_path, "w", encoding="utf-8") as f:
        f.write(json.dumps(data, indent=2))
        f.write("\n")