Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate API Versioning Prefix in Swagger UI Paths with Base URL Configuration #610

Open
JaisinhBhosale9712 opened this issue Feb 19, 2024 · 0 comments

Comments

@JaisinhBhosale9712
Copy link

Hello,

I am encountering an issue with API versioning in the Swagger UI generated by Flasger. I have structured my Flask application to use a Blueprint with a /v1 prefix for all routes to indicate the API version. Additionally, I have configured the Swagger servers URL to include this /v1 prefix as part of the base URL.

However, in the Swagger UI, this results in the /v1 prefix being displayed twice: once in the base URL and once in each of the individual endpoint paths. This redundancy in the version prefix could lead to confusion and does not reflect the intended API structure, especially as we consider adding more versions in the future (e.g., /v2).

Steps to Reproduce:
Create a Flask Blueprint with a /v1 prefix.
Define routes within this Blueprint.
Configure Flasger's Swagger UI with a servers URL that includes /v1.
Observe that in the Swagger UI, the /v1 prefix appears both in the base URL and in the individual endpoint paths.
Expected Behavior:
The Swagger UI should display the base URL with the /v1 prefix and then list the individual endpoint paths without this prefix, as they are already relative to the base URL specified. This would ensure clarity and prevent redundancy in the path display.

Actual Behavior:
The Swagger UI displays the /v1 prefix both in the base URL and in each of the individual endpoint paths, leading to redundancy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant