-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: add docs for swagger middleware #382
Conversation
content/en/docs/hertz/tutorials/basic-feature/middleware/swagger.md
Outdated
Show resolved
Hide resolved
content/en/docs/hertz/tutorials/basic-feature/middleware/swagger.md
Outdated
Show resolved
Hide resolved
content/zh/docs/hertz/tutorials/basic-feature/middleware/swagger.md
Outdated
Show resolved
Hide resolved
content/zh/docs/hertz/tutorials/basic-feature/middleware/swagger.md
Outdated
Show resolved
Hide resolved
content/zh/docs/hertz/tutorials/basic-feature/middleware/swagger.md
Outdated
Show resolved
Hide resolved
content/zh/docs/hertz/tutorials/basic-feature/middleware/swagger.md
Outdated
Show resolved
Hide resolved
content/zh/docs/hertz/tutorials/basic-feature/middleware/swagger.md
Outdated
Show resolved
Hide resolved
content/zh/docs/hertz/tutorials/basic-feature/middleware/swagger.md
Outdated
Show resolved
Hide resolved
content/zh/docs/hertz/tutorials/basic-feature/middleware/swagger.md
Outdated
Show resolved
Hide resolved
content/zh/docs/hertz/tutorials/basic-feature/middleware/swagger.md
Outdated
Show resolved
Hide resolved
LGTM |
|
||
## 使用用法 | ||
|
||
1. 在你的 API 源代码中添加注释, [参考 Declarative Comments Format](https://github.com/swaggo/swag/blob/master/README.md#declarative-comments-format)。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“参考”放在括号外面
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get it.thx.
go install github.com/swaggo/swag/cmd/swag@latest | ||
``` | ||
|
||
3. 在你的 Go 项目的根目录下运行 [Swag](https://github.com/swaggo/swag) (例如 `~/root/go-peoject-name`),[Swag](https://github.com/swaggo/swag) 将解析注释并生成必要的文件(`docs` 文件夹和 `docs/doc.go`)在 `~/root/go-peoject-name/docs` 目录下。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个文档里面出现了多次 Swag 链接,可以用如下方式:
[Swag][Swag]
...
[Swag][Swag]
...
// 文末
[Swag]: https://github.com/swaggo/swag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get it.thx.
What type of PR is this?
docs
What this PR does / why we need it (en: English/zh: Chinese):
en: Improve docs for swagger middleware
zh: 完善 swagger 中间件文档
Which issue(s) this PR fixes: