Description
I have 2 different routers in one file, that are included in main app, only first one is displayed in the extension (v1)
If I change order of routers definition (first one becomes v2 and only it is displayed)
Logs show that both routers are discovered
Extension logs
2026-03-12 20:35:36.412 [info] FastAPI extension 0.1.4 activated (VS Code 1.100.3)
2026-03-12 20:35:36.668 [info] Discovering FastAPI apps in 1 workspace folder(s)...
2026-03-12 20:35:36.768 [info] Found 1 candidate FastAPI file(s) in test-fastapi
2026-03-12 20:35:36.779 [info] Analyzed "file:///Users/<user>/Projects/test-fastapi/main.py": 0 routes, 1 routers, 2 include_router calls
2026-03-12 20:35:36.779 [info] Resolving include_router: router1 (prefix: none)
2026-03-12 20:35:36.793 [info] Analyzed "file:///Users/<user>/Projects/test-fastapi/routers.py": 4 routes, 2 routers, 0 include_router calls
2026-03-12 20:35:36.793 [info] Resolving include_router: router2 (prefix: none)
2026-03-12 20:35:36.794 [info] Skipping already visited file: "file:///Users/<user>/Projects/test-fastapi/routers.py"
2026-03-12 20:35:36.795 [info] Found 1 FastAPI app(s) with 2 route(s) in test-fastapi
Repository link (if open source)
No response
Project structure
test-fastapi/
├── pyproject.toml
├── main.py
└── routers.py
FastAPI app and router setup
# routers.py
from fastapi import APIRouter
router1 = APIRouter(prefix="/v1")
router2 = APIRouter(prefix="/v2")
@router1.post("/path1")
def route11() -> str:
return "v1"
@router1.post("/path2")
def route12() -> str:
return "v2"
@router2.post("/path1")
def route21() -> str:
return "v1"
@router2.post("/path2")
def route22() -> str:
return "v2"
# --------------------
# main.py
from fastapi import FastAPI
from routers import router1, router2
app = FastAPI()
app.include_router(router1)
app.include_router(router2)
pyproject.toml [tool.fastapi] section (if present)
VS Code version
Version: 1.100.3 (Universal)
FastAPI extension version
0.1.4
Python version
Python 3.14.3
FastAPI version
0.135.1
Operating system
masOS 26.1 (25B78)
Description
I have 2 different routers in one file, that are included in main app, only first one is displayed in the extension (v1)
If I change order of routers definition (first one becomes v2 and only it is displayed)
Logs show that both routers are discovered
Extension logs
Repository link (if open source)
No response
Project structure
FastAPI app and router setup
pyproject.toml [tool.fastapi] section (if present)
VS Code version
Version: 1.100.3 (Universal)
FastAPI extension version
0.1.4
Python version
Python 3.14.3
FastAPI version
0.135.1
Operating system
masOS 26.1 (25B78)