chore: endpoints.jsonに保存しないように

pull/105/head
yupix 10 months ago
parent f627275a43
commit 49132defff
No known key found for this signature in database
GPG Key ID: 2FF705F5C56D9C06

@ -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")

Loading…
Cancel
Save