Skip to content
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

Merged
merged 10 commits into from
Oct 25, 2022
Merged

Conversation

zstone12
Copy link
Contributor

@zstone12 zstone12 commented Oct 8, 2022

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:

@li-jin-gou li-jin-gou changed the title [WIP]doc: add docs for swagger middleware doc: add docs for swagger middleware Oct 22, 2022
@li-jin-gou
Copy link
Member

LGTM

@li-jin-gou li-jin-gou merged commit b10ed18 into cloudwego:main Oct 25, 2022

## 使用用法

1. 在你的 API 源代码中添加注释, [参考 Declarative Comments Format](https://github.com/swaggo/swag/blob/master/README.md#declarative-comments-format)。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“参考”放在括号外面

Copy link
Contributor Author

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` 目录下。
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get it.thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

7 participants