Skip to content

fix: resolve nested FastAPI router prefixes and include_router cascad… - #57

Open
rohith24576 wants to merge 1 commit into
Houseofmvps:mainfrom
rohith24576:fix/fastapi-route-prefix
Open

rohith24576 wants to merge 1 commit into
Houseofmvps:mainfrom
rohith24576:fix/fastapi-route-prefix

Conversation

@rohith24576

Copy link
Copy Markdown

Description

Fixes #55 by improving FastAPI route prefix resolution.

  • Supports modular package imports (from ... import module) and router definitions in __init__.py.
  • Resolves prefixes defined using string constants, variables, and f-strings (e.g., prefix=f"{API_V1_PREFIX}/consumer").
  • Handles multi-line include_router() calls and dotted router member references (e.g., consumer.consumer_router).
  • Preserves cascading mount edges when intermediate routers do not define their own prefixes.

Testing

  • Added a unit test in tests/detectors.test.ts covering the cascading prefix resolution scenario from FastAPI route prefix ignored #55.
  • Verified all tests successfully using pnpm test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FastAPI route prefix ignored

1 participant