1 Star 0 Fork 0

kade / mcube

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
swager.go 630 Bytes
一键复制 编辑 原始数据 按行查看 历史
kadegolang 提交于 2023-12-13 17:31 . copy
package apidoc
import (
restfulspec "github.com/emicklei/go-restful-openapi/v2"
"github.com/emicklei/go-restful/v3"
)
// API Doc
func APIDocs(apiDocPath string, docs restfulspec.PostBuildSwaggerObjectFunc) *restful.WebService {
config := restfulspec.Config{
WebServices: restful.RegisteredWebServices(),
APIPath: apiDocPath,
PostBuildSwaggerObjectHandler: docs,
DefinitionNameHandler: func(name string) string {
if name == "state" || name == "sizeCache" || name == "unknownFields" {
return ""
}
return name
},
}
return restfulspec.NewOpenAPIService(config)
}
1
https://gitee.com/go-kade/mcube.git
git@gitee.com:go-kade/mcube.git
go-kade
mcube
mcube
1225d9a674f1

搜索帮助