Skip to content

/api not taken into account #50

@MiguelElGallo

Description

@MiguelElGallo

Hello @pamelafox ,
I was wondering if you can give me hand with something:

I'm using:
server = FastAPI( servers=[{"url": "/api", "description": "Endpoints for the API"}], root_path="/public", root_path_in_servers=False, title="Demo FastAPI function", lifespan=lifespan, )

This solves the location of the openapi.json file, thanks a and great!

But then I have a router:
router = APIRouter(prefix="/v1/control_table", tags=["control_table"])

In the UI show like this:

fastapitest

In 1 you can see there no /api in the URL, but in 2 you can see there is /api in the url, which then fails.

The endpoint is deployed without /api, but the UI thinks there is /api prefix.

Do you have any hints how to solve this?

Thanks!
MIguel
PS.: I have been trying with the prefix and when adding the router, but with no luck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions