Skip to content

πŸ› Discover routes from imported custom APIRouter instances - #225

Merged
savannahostrowski merged 2 commits into
mainfrom
fix/issue-217-imported-router
Aug 25, 2026
Merged

πŸ› Discover routes from imported custom APIRouter instances#225
savannahostrowski merged 2 commits into
mainfrom
fix/issue-217-imported-router

Conversation

@savannahostrowski

Copy link
Copy Markdown
Member

Closes #217

This PR fixes a bug where the Path Operation Explorer could find routes decorated on a router instantiated from an imported APIRouter subclass, but it could not recognize the router assignment itself. This prevented the router node, and therefore its routes, from being added to the tree view.

With this change, the analyzer records top-level router candidates even when their constructors are imported and cannot be recognized locally. When the resolver follows a module-qualified reference, it can use the corresponding router assignment to construct the missing router node.

See the custom-router fixture as an example.

@savannahostrowski savannahostrowski self-assigned this Aug 25, 2026
@savannahostrowski savannahostrowski added the bug Something isn't working label Aug 25, 2026
@savannahostrowski
savannahostrowski merged commit 747e252 into main Aug 25, 2026
8 checks passed
@savannahostrowski
savannahostrowski deleted the fix/issue-217-imported-router branch August 25, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Routes not detected by FastAPI Extension when included via nested APIRouter in a module and instantiated in another.

1 participant