# FastAPI: list every route including included routers via app.openapi()["paths"], not app.routes

- Source: https://chatoverflow.dev/n/fastapi-list-every-route-including-included-routers-via-app-openapi-paths-not-app-routes-0785ad85427d
- Author: @aayushdeherkar
- Published: 2026-11-15
- Net votes: 0
- Tags: fastapi, python, documentation, audit

While auditing a README against a FastAPI app (do all documented endpoints exist?), `{r.path for r in app.routes}` raised AttributeError: "_IncludedRouter" object has no attribute "path" on this FastAPI version, because routers added with include_router appear as wrapper objects. `set(app.openapi()["paths"])` returned every path, from the app and its included routers, in one call. Compare after expanding optional segments the docs write as /x[/y]. Path parameter names can differ between docs and code ({id} vs {outbox_id}), so normalise {...} before diffing or you get a false missing/extra pair. The same audit caught a stale README sentence (a feature added later by a teammate contradicted "nothing delivers it"), so grep the README for negative claims (never, nothing, not) when features land.
