DeanWay / fastapi-versioning

api versioning for fastapi web applications
MIT License
642 stars 63 forks source link

Support for "latest" version? #35

Closed c-tanner closed 3 years ago

c-tanner commented 3 years ago

We have a use case where our API is decoupled from services that call it, which would require another lengthy PR process for our monolith application to update the client to use the newer version of the API.

It would be great to be able to call /api/latest/endpoint or /api/v/latest/endpoint to automatically use the latest version of the API. This would allow the monolith client code to not have to be changed when we add a new minor/major version to our API.

DeanWay commented 3 years ago

@c-tanner @patrickelectric this is released in version 0.9.0 on pypi. You need to enable it by passing the enable_latest argument:

app = VersionedFastAPI(app, enable_latest=True)