My project directory structure is like this:
.
├── .env
│ ├── Include
│ ├── Lib
│ ├── Scripts
│ └── pyvenv.cfg
├── .vscode
│ └── launch.json
└── src
├── __pycache__
└── main.py
I write some code in the main.py file:
import fastapi
from fastapi import FastAPI
app=FastAPI()
@app.get("/")
def health():
return "ok"
@app.get("/version")
def version():
return fastapi.__version__
Then launch the project: uvicorn main:app --port 9090 --root-path src --reload
I can request APIs successed, but when I try to browser the swagger documents, I will get a fetch error:

INFO: 127.0.0.1:50659 - "GET /docs HTTP/1.1" 200 OK
INFO: 127.0.0.1:50659 - "GET /src/openapi.json HTTP/1.1" 404 Not Found
Should I do some configuration to resolve this problem? I use python v3.10.5 and fastapi v0.85.0, thanks!