fastapi 设置docs不显示某个接口的说明

fastapi 设置docs不显示某个接口的说明

只需要设置include_in_schema = False

from typing import List
from starlette.responses import RedirectResponse
from fastapi import Depends, FastAPI, HTTPException ,Body
import uvicorn
app = FastAPI(title="Project Health",version="1.0")


@app.get("/",include_in_schema = False)
async def help():
    response=RedirectResponse("http://1127.0.0.1:10240/docs")
 return response
    # return "please visit  for more detail"
posted @ 2020-12-25 15:05  不要摸我的腰  阅读(620)  评论(0编辑  收藏  举报