Skip to content

Support aliased FastAPI and APIRouter imports#104

Closed
Ashif4354 wants to merge 1 commit intofastapi:mainfrom
Ashif4354:fix/aliased-import
Closed

Support aliased FastAPI and APIRouter imports#104
Ashif4354 wants to merge 1 commit intofastapi:mainfrom
Ashif4354:fix/aliased-import

Conversation

@Ashif4354
Copy link

The extension could not find the FastAPI app if it was imported with an alias (for example, from fastapi import FastAPI as FA). The discovery logic only looked for the exact text "FastAPI(". This caused the extension to completely miss valid applications that used different naming styles.

So updated the discovery process and the parser so the extension can now understand and detect aliased imports.

This fixes #102

@savannahostrowski
Copy link
Member

Hey there - thanks for opening this! However, I ended up refactoring the extractors quite substantially in #107 to address a few other issues and ended up fixing this as well. Appreciate the PR though!

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.

Aliased FastAPI/APIRouter imports is not getting detected

2 participants