From 49132defff081270f89c9097d7089dcddf80e787 Mon Sep 17 00:00:00 2001 From: yupix Date: Wed, 29 Nov 2023 12:04:59 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20endpoints.json=E3=81=AB=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compiler/endpoints.py | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/compiler/endpoints.py b/compiler/endpoints.py index d60efbc..239fecf 100644 --- a/compiler/endpoints.py +++ b/compiler/endpoints.py @@ -1,5 +1,4 @@ import json -import os from type import OpenAPI @@ -22,23 +21,6 @@ with open("./datas/v13_api.json", mode="r", encoding="utf-8") as f: PATHS.append(f"{PREFIX}{path}") -old_endpoints = [] -if os.path.exists("./datas/endpoints.json"): - with open("./datas/endpoints.json", mode="r", encoding="utf-8") as f: - old_endpoints = json.load(f) - -with open("./datas/endpoints.json", mode="w", encoding="utf-8") as f: - removed_endpoints = [] - for i in old_endpoints: - if i not in list(dict.fromkeys(PATHS)): - removed_endpoints.append(i) - with open("./datas/removed-endpoints.json", mode="w", encoding="utf-8") as removed_endpoints_f: - json.dump(removed_endpoints, removed_endpoints_f, ensure_ascii=False, indent=4) - - old_endpoints.extend(PATHS) - old_endpoints = list(dict.fromkeys(old_endpoints)) - json.dump(old_endpoints, f, ensure_ascii=False, indent=4) - with open("../mipac/types/endpoints.py", "w", encoding="utf-8") as f: - data = json.dumps(old_endpoints, ensure_ascii=False, indent=4) + data = json.dumps(PATHS, ensure_ascii=False, indent=4) f.write(f"{TOP_COMMENT}{IMPORTS}{TEMPLATES}Literal{data}\n")