Skip to content

πŸ› Support factory function apps when entrypoint is configured#101

Merged
savannahostrowski merged 3 commits intomainfrom
fix-app-factory-pattern
Mar 4, 2026
Merged

πŸ› Support factory function apps when entrypoint is configured#101
savannahostrowski merged 3 commits intomainfrom
fix-app-factory-pattern

Conversation

@savannahostrowski
Copy link
Member

@savannahostrowski savannahostrowski commented Mar 3, 2026

Closes #100

The issue here was that when a FastAPI app is returned by a factory function (app = create_app()), static analysis can't determine its type from the assignment alone, so the router graph couldn't be built. When an entrypoint is configured ([tool.fastapi] in pyproject.toml or fastapi.entryPoint in VS Code settings), we now use the configured variable name directly to build the route graph.

@savannahostrowski savannahostrowski added the bug Something isn't working label Mar 3, 2026
@savannahostrowski savannahostrowski merged commit f6ee9f7 into main Mar 4, 2026
5 checks passed
@savannahostrowski savannahostrowski deleted the fix-app-factory-pattern branch March 4, 2026 16:02
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.

Fails to find FastAPI app when app object is returned by a method

1 participant