Files
Atomizer/tests/check_api_routes.py

21 lines
484 B
Python
Raw Normal View History

"""Check API routes from running backend."""
import requests
import json
# Get OpenAPI spec
resp = requests.get("http://localhost:8000/openapi.json", timeout=10)
spec = resp.json()
# Find insight routes
print("Insight-related routes:")
print("=" * 60)
for path in sorted(spec.get("paths", {}).keys()):
if "insight" in path.lower():
print(f" {path}")
print()
print("All routes:")
print("-" * 60)
for path in sorted(spec.get("paths", {}).keys()):
print(f" {path}")