[BUG] Incorrect ReDoc resource URL when "app.mount" is used
See original GitHub issueDescribe the bug
There is a bug when API is organized with different versions (FastAPI apps) which mounted via global app.mount
.
ReDoc duplicates mount’s prefix. For example, http://127.0.0.1:8000/v1/v1/test
.
It works well in default OpenAPI Docs.
Environment:
- OS: [e.g. Linux / Windows / macOS]
- FastAPI Version [e.g. 0.3.0], get it with: 0.40.0
Additional context
import fastapi
from fastapi import APIRouter
app = fastapi.FastAPI(docs_url=None, redoc_url=None)
router = APIRouter()
@router.get("/users/", tags=["users"])
async def read_users():
return [{"username": "Foo"}, {"username": "Bar"}]
apiV1 = fastapi.FastAPI(openapi_prefix="/v1", version="1.0.0")
apiV1.include_router(router)
app.mount("/v1", apiV1)
Screenshot
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (2 by maintainers)
Top Results From Across the Web
[BUG] Incorrect ReDoc resource URL when "app.mount" is used -
[BUG] Incorrect ReDoc resource URL when "app.mount" is used. ... There is a bug when API is organized with different versions (FastAPI apps)...
Read more >tiangolo/fastapi - Gitter
Hi to all! Any ideas, how I can wrap WSGIMiddleware ? I.e. I need to check login/session before the users access the /v1...
Read more >Available CRAN Packages By Name
Available CRAN Packages By Name ; ABACUS, Apps Based Activities for Communicating and Understanding Statistics ; abbreviate, Readable String Abbreviation ; abbyyR ...
Read more >FastAPI in Containers - Docker
This way, containers consume little resources, an amount comparable to running the processes directly (a virtual machine would consume much more).
Read more >NGINX Controller v3.0.0–3.18.3
The no_root_squash option must be set for the mount point on the NFS server. If this is not allowed, the owner of the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@HacKanCuBa thank you so much for your research!
Oh shit, I got it!
Gonna check it out in the code