Skip to content

Commit

Permalink
feat(jzero): update swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
jaronnie committed Jul 6, 2024
1 parent 7944412 commit 6cf2237
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var checkCmd = &cobra.Command{
log.Info("\n[jzero-env]: looking up goctl-swagger")
_, err = env.LookPath("goctl-swagger")
if err != nil {
_ = golang.Install("github.com/zeromicro/goctl-swagger@latest")
_ = golang.Install("github.com/jzero-io/goctl-swagger@latest")
}
if _, err = env.LookPath("goctl-swagger"); err == nil {
log.Success(`[jzero-env]: "goctl-swagger" is installed`)
Expand Down
13 changes: 13 additions & 0 deletions docs/src/guide/genswagger.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ icon: lightbulb
order: 5.1
---

## 说明

同时支持基于 go-zero api 文件和 protobuf 文件自动生成 swagger 文档

其中自动生成 swagger 的插件如下:

* [goctl-swagger](https://github.com/jzero-io/goctl-swagger)
* [protoc-gen-openapiv2](https://github.com/grpc-ecosystem/grpc-gateway/tree/main/protoc-gen-openapiv2)

> 由于 go-zero 官方仓库插件 goctl-swagger 不怎么维护了, 并在实际使用中存在一些 bug, 所以 fork 了一份进行维护.
jzero 框架默认增加了在线访问 swagger ui 的路由

::: code-tabs#shell

@tab jzero
Expand Down

0 comments on commit 6cf2237

Please sign in to comment.