athena_rs 2.0.2

Database gateway API
Documentation
import pathlib
import re
from collections import defaultdict

root = pathlib.Path("src")
pattern = re.compile(r'#[ \t]*\[\s*(get|post|put|patch|delete)\s*\(\s*"([^\"]+)"')
seen = defaultdict(set)
for path in root.rglob("*.rs"):
    rel = path.relative_to(root)
    if not (str(rel).startswith("api") or str(rel).startswith("wss")):
        continue
    text = path.read_text(encoding="utf-8")
    for match in pattern.finditer(text):
        seen[match.group(2)].add(match.group(1).upper())

openapi_text = pathlib.Path("openapi.yaml").read_text(encoding="utf-8")
paths = [
    match.group(1)
    for match in re.finditer(r"^  (/[^:]*):", openapi_text, flags=re.MULTILINE)
]
missing = sorted(route for route in seen if route not in paths)
print(f"Parsed {len(seen)} routes from code")
print(f"Found {len(paths)} paths in openapi spec")
if missing:
    print("Routes missing from openapi:")
    for route in missing:
        print(f"  {route}")
else:
    print("No missing routes.")