-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Subject of the issue
I am trying to figure out how to make Swagger display the version prefix, like /api/latest in the servers list, and the API route excludes that prefix. This way, the swagger UI paths contain only the base paths. So my two questions are:
- Can this be achieved with the current implementation?
- Would you consider changing the API to add this functionality?
Your environment
Python 3.11.4
Ubuntu 22.04
Steps to reproduce
Running custom docs example from here: https://github.com/alexschimpf/fastapi-versionizer/blob/main/examples/docs_customization.py
Desired behavior
I'd love to get this as a result. The server contains /v1_0, and all the paths are "base."

I achieved this by changing the _build_version_router to router = APIRouter() (no prefix) and in the versionize changed self._app.include_router(router=version_router, prefix=version_prefix).
Actual behavior
Each version path repeatedly starts with the version prefix /v1_0

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels