DeanWay / fastapi-versioning

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

Versioning in headers #52

Open olaf7 opened 3 years ago

olaf7 commented 3 years ago

This website: https://restfulapi.net/ is a nice write up to discuss REST API with references to Fielding's dissertation. They also have a page on versioning where a paragraph on URI versioning suggests to use headers instead of URIs. It would be nice if fastapi-versioning would support this. See: https://restfulapi.net/versioning/

dirkbrnd commented 2 years ago

I also want to do this! I.e. pass a version=2020-01-01 header and have the application route to a different endpoint, even if that has to be on a different URL internally, thats fine. As long as the external-facing URL is without a version.

HHK1 commented 2 years ago

Posted something on a FastAPI issue here to showcase how it could be done: https://github.com/tiangolo/fastapi/issues/3910#issuecomment-1024132161