Skip to content

fix: skip non-APIRoute entries (Starlette >=1.3.1 compatibility)#79

Open
dajiaohuang wants to merge 1 commit into
DeanWay:masterfrom
dajiaohuang:fix/78-starlte-included-router
Open

fix: skip non-APIRoute entries (Starlette >=1.3.1 compatibility)#79
dajiaohuang wants to merge 1 commit into
DeanWay:masterfrom
dajiaohuang:fix/78-starlte-included-router

Conversation

@dajiaohuang

Copy link
Copy Markdown

Starlette 1.3.1+ adds _IncludedRouter objects to app.routes which do not have an .endpoint attribute, causing VersionedFastAPI to crash at startup.

Filter app.routes to only APIRoute instances before building version routes.

Fixes #78

Starlette >=1.3.1 adds _IncludedRouter to app.routes which
don't have .endpoint attribute. Filter them out with isinstance().

Fixes DeanWay#78
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.

Incompatibility with FastAPI 0.137+ / Starlette 1.3.1+

1 participant