1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-openapi synced 2026-01-11 23:50:26 +01:00
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2023-05-05 19:07:30 +09:00
parent d9ab053b00
commit e3bb72f2ef
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA

View file

@ -41,9 +41,9 @@ for lang in config.main().keys():
load["paths"][path][method] = value
load["paths"][key] = load["paths"].pop(path)
escape = path.replace("/", "~1")
relative = file.replace(config.INPUT_DIR, "", 1)
paths.update({key: {"$ref": f".{relative}#/paths/{escape}"}})
escape = key.replace("/", "~1")
relative = file.replace(config.INPUT_DIR, "", 1)
paths.update({key: {"$ref": f".{relative}#/paths/{escape}"}})
with open(dist_replace(file), mode="w+", encoding="utf-8") as f:
f.write(yaml.dump(load))
@ -52,8 +52,8 @@ for lang in config.main().keys():
with open(file, mode="r", encoding="utf-8") as f:
openapi = yaml.safe_load(f)
for path in paths:
load["paths"] = paths
openapi["paths"] = paths
with open(dist_replace(file), mode="w+", encoding="utf-8") as f:
f.write(yaml.dump(load))
f.write(yaml.dump(openapi))
print("=== Build End ===")