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:
parent
b6228ba2d5
commit
1d16792681
1 changed files with 0 additions and 16 deletions
|
|
@ -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}")
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue