From 1d1679268188f0bd96a4072cd397a5aa8964084e Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 25 Jul 2021 03:45:16 +0100 Subject: [PATCH] Removing unnecessary validation code I wrote test_swagger_yaml before I realised I could validate the API with apispec directly. --- docs/test_swagger_yaml.py | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 docs/test_swagger_yaml.py diff --git a/docs/test_swagger_yaml.py b/docs/test_swagger_yaml.py deleted file mode 100644 index 560a76bc..00000000 --- a/docs/test_swagger_yaml.py +++ /dev/null @@ -1,16 +0,0 @@ -import yaml - -with open("./build/swagger.yaml", "r") as f: - api = yaml.load(f) - -for path, methods in api["paths"].items(): - for method, properties in methods.items(): - try: - for k in ["responses", "description"]: - current_key = k - _ = properties[k] - for code, r in properties["responses"].items(): - current_key = f"responses/{code}/description" - _ = r["description"] - except KeyError as e: - print(f"❌ {method} {path} has a problem: {e} from {current_key}")