mirror of
https://github.com/thegeneralist01/twitter-openapi
synced 2026-01-11 23:50:26 +01:00
fix
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
parent
d9ab053b00
commit
e3bb72f2ef
1 changed files with 5 additions and 5 deletions
|
|
@ -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 ===")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue