fastapi-versioning
fastapi-versioning copied to clipboard
Maintained Fork Inquiry
Are there a good number of people interested in this still? Could potentially fork this and address some of the issues here based off how many people would want that. I see it hasn't been maintained in over a year.
I would say given the number of forks (53) and PRs (7) and the fact that the latest 3 PRs were only ~4 months ago, you'd have a pretty reasonable chance of success by forking it. Not sure about the pypi packaging though...
@akliang yeah the pypi packaging issue is tough would need the key from current maintainer
@TheJumpyWizard @akliang
I created my own package based on fastapi_versioning
.
It fixes most of the bugs noted on here and adds some additional features.
https://github.com/alexschimpf/fastapi-versionizer
https://pypi.org/project/fastapi-versionizer/
Some notable differences:
- Package includes
py.typed
so mypy will actually be able to type check it -
kwargs
are passed to all versioned sub-applications - You can provide a function to generate custom OpenAPI schemas for each sub-application
- You can provide a function to generate custom Swagger/Redoc HTML for each sub-application
- You can provide a custom "latest" prefix
- Currently, "/" as a latest prefix is not supported though
- Websocket routes are now handled
- The versioning is applied directly to your FastAPI app, instead of generating a new FastAPI app object
- The
versionize
function returns a list of all the versions in your app - The
version
decorator is now calledapi_version
-
dependency_overrides
is preserved - A main docs page is not generated. But this can be easily accomplished like so: https://github.com/alexschimpf/fastapi-versionizer/blob/main/examples/advanced.py#L125
- You can generate a Swagger page to expose an automatically generated "/versions" endpoint or you can generate your own custom HTML page
If ya'll have any feedback, let me know. Happy to make changes or add new features.