使用 Iris + Swag 的端点 grouping/collection
Endpoint grouping/collection using Iris + Swag
如何按 Party 对端点进行分组?我应该使用哪个 declaration/annotation 评论?我有这个:
我需要将端点按“书籍”、“目录”等内容进行分组,...而不是一个唯一的未命名“默认”组。我怎样才能做到这一点?
PS: 我的问题和这个, but I'm using Iris-Go, and this插件类似
更新1
.json file
Iris-go 在后台使用 gin-swagger/swaggo。在 Swagger 中,要对端点进行分组,添加 tags 就足够了(请参阅 https://swagger.io/docs/specification/grouping-operations-with-tags/)。
在 swaggo 中,您需要在端点注释中使用 @Tags
declarative parameter,如下所示:
// @Tags: Books
请参阅带有 @Tags
here 的 swaggo 示例代码。
如何按 Party 对端点进行分组?我应该使用哪个 declaration/annotation 评论?我有这个:
我需要将端点按“书籍”、“目录”等内容进行分组,...而不是一个唯一的未命名“默认”组。我怎样才能做到这一点?
PS: 我的问题和这个
更新1
.json file
Iris-go 在后台使用 gin-swagger/swaggo。在 Swagger 中,要对端点进行分组,添加 tags 就足够了(请参阅 https://swagger.io/docs/specification/grouping-operations-with-tags/)。
在 swaggo 中,您需要在端点注释中使用 @Tags
declarative parameter,如下所示:
// @Tags: Books
请参阅带有 @Tags
here 的 swaggo 示例代码。