Endpoint grouping/collection using Iris + Swag

669 Views Asked by At

How can I group the endpoints by Party ? Which declaration/annotation comment should I use ? I'm having this:

enter image description here

I need the endpoints to be grouped by something like "Books", "Catalogs" and so on,... not one unique unnamed "default" group. How can I achieve that?

PS: My problem is similar to this link, but I'm using Iris-Go, and this plug-in.

UPDATE1

.json file

1

There are 1 best solutions below

3
blami On BEST ANSWER

Iris-go uses gin-swagger/swaggo under the hood. In Swagger to get endpoints grouped it should be enough to add tags (see https://swagger.io/docs/specification/grouping-operations-with-tags/).

In swaggo you need to use @Tags declarative parameter in endpoint comment like this:

// @Tags: Books

See swaggo example code with @Tags here.