如何关闭文档?

要隐藏部分接口,可以在路由装饰器上面添加一个参数include_in_schema=False,如下所示:

@app.post('/login', include_in_schema=False)

关闭全部文档,实例化FastAPI对象时,传入以下参数.

 app = FastAPI(
        docs_url=None,
        redoc_url=None,
        openapi_url=None
    )

相关文章:

  • 2022-12-23
  • 2022-02-08
  • 2021-11-13
  • 2022-12-23
  • 2021-11-21
  • 2021-11-30
  • 2021-11-17
猜你喜欢
  • 2021-06-23
  • 2021-06-22
  • 2022-02-19
  • 2022-12-23
  • 2021-06-28
  • 2021-12-10
  • 2021-08-10
相关资源
相似解决方案