Removing unnecessary validation code

I wrote test_swagger_yaml before I realised I could
validate the API with apispec directly.
This commit is contained in:
Richard 2021-07-25 03:45:16 +01:00
parent b6228ba2d5
commit 1d16792681

View file

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