I use 招摇的用户界面 https://github.com/swagger-api/swagger-ui显示API文档。默认情况下,它在底部显示“模型”部分:
如何隐藏它?
要隐藏“模型”部分,请添加defaultModelsExpandDepth: -1
到您的 Swagger UI 配置代码index.html
.
注意选项名称使用复数Model*s*
not Model
.
// index.html
<script>
window.onload = function() {
// Begin Swagger UI call region
const ui = SwaggerUIBundle({
url: "https://petstore.swagger.io/v2/swagger.json",
dom_id: '#swagger-ui',
defaultModelsExpandDepth: -1, // <-------
Swagger UI 还有很多其他的配置选项 https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md控制 API 文档呈现。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)