DeanWay / fastapi-versioning

api versioning for fastapi web applications
MIT License
659 stars 64 forks source link

Versioning causes FastAPI-Redis plugin to malfunction #56

Open fusion44 opened 3 years ago

fusion44 commented 3 years ago

Describe the bug As soon as I activate VersionedFastAPI the Redis plugin throws an error in depends_redis() function. Seems like Redis is not properly initialized. The Redis object simply is not there when depends_redis wants to return it. The startup function is called normally and the Redis object is initialized but in a different version of the FastAPI app that is not used in versioned routes. I've added more comments to the gist posted below.

To Reproduce Here's a minimal code snipped to reproduce the problem: https://gist.github.com/fusion44/8b9867e13a03edf29388f6b9c9e4b8ca

Expected behavior Redis to be available on any depends call.

Thank you.