【发布时间】:2016-10-13 14:40:16
【问题描述】:
默认情况下,ApiDoc 会列出每个 API 端点的所有操作,如下所示:
然而,在Swagger demo 中,操作默认隐藏,直到用户选择显示它们。
ApiDoc 是否有默认隐藏操作的配置选项?我在documentation 中没有找到类似的内容。
【问题讨论】:
标签: symfony swagger nelmioapidocbundle
默认情况下,ApiDoc 会列出每个 API 端点的所有操作,如下所示:
然而,在Swagger demo 中,操作默认隐藏,直到用户选择显示它们。
ApiDoc 是否有默认隐藏操作的配置选项?我在documentation 中没有找到类似的内容。
【问题讨论】:
标签: symfony swagger nelmioapidocbundle
您必须像这样更改 config.yml 文件(default_sections_opened 为 false):
nelmio_api_doc:
name: 'API documentation'
exclude_sections: []
**default_sections_opened: false**
motd:
template: 'NelmioApiDocBundle::Components/motd.html.twig'
request_listener:
enabled: true
parameter: _doc
sandbox:
enabled: false
【讨论】:
使用参数default_sections_opened可以默认隐藏文档部分:
nelmio_api_doc.default_sections_opened: false
此参数的默认值为true。见configuration reference。
【讨论】: