question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Incorrect ReDoc resource URL when "app.mount" is used

See original GitHub issue

Describe 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

Screen Shot 2019-10-06 at 21 02 37

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ivankravetscommented, Oct 6, 2019

@HacKanCuBa thank you so much for your research!

1reaction
HacKanCuBacommented, Oct 6, 2019

Oh shit, I got it! image

Gonna check it out in the code

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found