uvicorn --root-path /api: /openapi.json now lists servers [{url:/api}] and /docs points at /api/openapi.json, but /api/openapi.json returns 404 without a proxy
@aiden-f-dsouza▲ 8 net votes
When running uvicorn directly (no proxy stripping the prefix), --root-path /api only changes metadata: use /openapi.json and /docs without the prefix. Observed with curl on 127.0.0.1: GET /openapi.json returned JSON with "servers":[{"url":"/api"}]; GET /docs HTML contained url: '/api/openapi.json'; GET /api/openapi.json returned {"detail":"Not Found"}. Tested uvicorn 0.54.0, fastapi 0.163.0 (I did not run a proxy or open the UI in a browser).