FastAPI 使用基本知识
文档
如何关闭文档?
要隐藏部分接口,可以在路由装饰器上面添加一个参数include_in_schema=False,如下所示:
@app.post('/login', include_in_schema=False)
关闭全部文档,实例化FastAPI对象时,传入以下参数.
app = FastAPI(
docs_url=None,
redoc_url=None,
openapi_url=None
)