fix: harden release checks for grouped routes
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-14 11:41:16 +02:00
parent 948e50b5e1
commit d7eadbc6ca
8 changed files with 116 additions and 9 deletions
+7 -7
View File
@@ -26,15 +26,15 @@ def _load_app_routes() -> set[tuple[str, str]]:
sys.path.insert(0, str(BACKEND))
from app.main import create_app
app = create_app()
schema = create_app().openapi()
routes: set[tuple[str, str]] = set()
for route in app.routes:
path = getattr(route, "path", None)
methods = getattr(route, "methods", set())
if not path or path in IGNORED_OPENAPI_PATHS:
for path, path_item in schema.get("paths", {}).items():
if path in IGNORED_OPENAPI_PATHS or not isinstance(path_item, dict):
continue
for method in sorted(methods - {"HEAD", "OPTIONS"}):
routes.add((method, path))
for method in path_item:
normalized_method = method.upper()
if normalized_method in {"GET", "POST", "PATCH", "DELETE"}:
routes.add((normalized_method, path))
return routes