-1

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

Helen
  • 87,344
  • 17
  • 243
  • 314

1 Answers1

2

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.

blami
  • 6,588
  • 2
  • 23
  • 31
  • Thanks blami but I do have @Tags in my code, and there is no grouping though. https://github.com/dani-fmena/go.api.backend/blob/master/api/endpoints/Books.go – Ashigaruconyary Mar 09 '21 at 05:49
  • 2
    It is `@Tags` (even if its just one tag) and not `@Tag` as you have it in your code. – blami Mar 09 '21 at 07:33
  • Blami you’re totally right. Now you pointed out I notice my mistake. I don’t read the spec carefully (I would like to think I was too tired ) I'm going to cross-reference the issue I posted on the iris-contrib/swagger repo to your solution. Thanks again. – Ashigaruconyary Mar 09 '21 at 14:35