You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
648 B
20 lines
648 B
import json
|
|
|
|
with open("scripts/openapi.json", encoding="utf-8") as f:
|
|
spec = json.load(f)
|
|
|
|
paths = spec.get("paths", {})
|
|
rows = []
|
|
for p, methods in sorted(paths.items()):
|
|
for m, op in methods.items():
|
|
if m.lower() not in ("get","post","put","delete","patch"):
|
|
continue
|
|
summary = op.get("summary") or op.get("description") or ""
|
|
tags = ",".join(op.get("tags", []))
|
|
rows.append((m.upper(), p, summary, tags))
|
|
|
|
print(f"TOTAL PATH-METHODS: {len(rows)}")
|
|
print(f"TOTAL DISTINCT PATHS: {len(set(r[1] for r in rows))}")
|
|
print("="*100)
|
|
for m, p, s, t in rows:
|
|
print(f"{m:6} {p:55} [{t}] {s[:40]}")
|
|
|