DeanWay / fastapi-versioning

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

Add latest endpoint for the latest API version #45

Closed patrickelectric closed 3 years ago

patrickelectric commented 3 years ago

Fix #35

DeanWay commented 3 years ago

thanks @patrickelectric. Looks good to me. My only thought is that this may not be something that everyone would want out of a versioned API? (perhaps if you're going through the trouble of versioning your API you wouldn't want to allow your clients to break out of specifying a version).

My thoughts for how to handle that would be:

  1. add an argument for this. (something like include_latest_path), I think it would even be fine to default this to True.
  2. Expose the list of versions and just document the redirect endpoint you've added here as a recipe to optionally include in your own application
patrickelectric commented 3 years ago

Done @DeanWay, let me know what you think: image

DeanWay commented 3 years ago

the CI check is failing due to a lint error, I'll fix it on master