Skip to content

Commit

Permalink
refactor(plugins/openapi/swagger): 删除 displayOperationId 属性
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Nov 23, 2024
1 parent 5c0f12d commit 6dfadd1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugins/openapi/openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
//
// SPDX-License-Identifier: MIT

// package openapi 提供 [github.com/isse9/web/openapi] 文档的阅读器
// package openapi 提供 [github.com/issue9/web/openapi] 文档的阅读器
package openapi
6 changes: 3 additions & 3 deletions plugins/openapi/swagger/swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ func Install(s web.Server) {
// 可用来代替 [openapi.WithHTML]
//
// assets swagger 的页面资源,可以直接引用 [OnlineAssets],也可以指向自有的服务器;
// favicon 图标
// logo 图标
//
// [swagger]: https://swagger.io/docs/open-source-tools/swagger-ui/usage/installation/
func WithHTML(assets, favicon string) openapi.Option {
return openapi.WithHTML("swagger", assets, favicon)
func WithHTML(assets, logo string) openapi.Option {
return openapi.WithHTML("swagger", assets, logo)
}

// WithOnlineHTML 采用 [OnlineAssets] 作为参数的 [WithHTML] 版本
Expand Down
3 changes: 1 addition & 2 deletions plugins/openapi/swagger/swagger.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>{{.Info.Title}}</title>

{{if .Info.Description}}<meta name="description" content="{{.Info.Description}}" />{{end}}
{{if .XFavicon}}<link rel="icon" href="{{.XFavicon}}">{{end}}
{{if .XLogo}}<link rel="icon" href="{{.XLogo}}">{{end}}

<link rel="stylesheet" href="{{.XAssets}}/swagger-ui.css" />
</head>
Expand All @@ -19,7 +19,6 @@
window.ui = SwaggerUIBundle({
spec: {{ json . }},
dom_id: '#swagger-ui',
displayOperationId: true,
});
};
</script>
Expand Down

0 comments on commit 6dfadd1

Please sign in to comment.