You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using VersionedFastAPI wrapper object, lifespan event is not called
To Reproduce
Run
fromcontextlibimportasynccontextmanagerfromfastapiimportFastAPIfromfastapi_versioningimportVersionedFastAPI@asynccontextmanagerasyncdeflifespan(app: FastAPI):
print("Starting app")
yieldprint("Stopping app")
app=FastAPI(lifespan=lifespan)
# run uvicorn main:app with and without VersionedFastAPI# app = VersionedFastAPI(app)
Expected behavior
The lifespan events should still be called using or not using VersionedFastAPI
The text was updated successfully, but these errors were encountered:
We ran into this same problem so I wanted to just drop you a note, you can pass the lifespan=lifespan to the VersionedFastAPI(app) call and it should work. That constructor takes kwargs and passes them onto the base FastAPI app.
Describe the bug
When using VersionedFastAPI wrapper object, lifespan event is not called
To Reproduce
Run
Expected behavior
The lifespan events should still be called using or not using VersionedFastAPI
The text was updated successfully, but these errors were encountered: