想用 fastapi 来做个小站,提供 api,但部分接口如注册接口这些想隐藏一下,不在 swagger 显示,请问如何实现.

1 mirrorpen Jun 12, 2020 那注册接口不写 swagger 注释不就行了吗?是这个意思吗.. |
2 yRebelHero Jun 12, 2020 |
3 yumenlong OP 找到了,@app.get("/items/", include_in_schema=False) To exclude a path operation from the generated OpenAPI schema (and thus, from the automatic documentation systems), use the parameter include_in_schema and set it to False; |