未分類 27 6 月 2020 fastapi 如何实现 swagger 隐藏某个具体 api 呢 fastapi 如何实现 swagger 隐藏某个具体 api 呢 資深大佬 : yumenlong 10 想用 fastapi 来做个小站,提供 api,但部分接口如注册接口这些想隐藏一下,不在 swagger 显示,请问如何实现. 大佬有話說 (3) 資深大佬 : mirrorpen 那注册接口不写 swagger 注释不就行了吗?是这个意思吗.. 資深大佬 : yRebelHero @ApiIgnore 主 資深大佬 : yumenlong 找到了,@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;