From e3bb72f2ef3cc9e3c1e37a96315f291bf6ebc3fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Fri, 5 May 2023 19:07:30 +0900 Subject: [PATCH] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- tools/build.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/build.py b/tools/build.py index ab39d16..3b25ddf 100644 --- a/tools/build.py +++ b/tools/build.py @@ -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 ===")