I was testing the new feature and noticed that the Tags auto generated are using the Route or Path of the endpoint.
Would it be possible to add a Tags annotation to allow multiple endpoints to be grouped together using the swagger
specs.
tags [Tag Object] A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the Operation Object must be declared. The tags that are not declared may be organized randomly or based on the tools’ logic. Each tag name in the list MUST be unique.
For example:
/Movies/
/Movies/{Id}
/Movies/{Id}/Videos
Could share the tag “Movies” and also “Entertainment” so that they are grouped together rather than all having their own individual tag, which is how it appears now.
Thanks for the quick response. I am a little unclear how I would modify a tag based on certain operations.
Can I do some kind of case when operation.OperationId = “xyz”, operation.Tags.Add(“abc”);
OperationId is unique and is created as concatenation of DTO type name and operation postfix (_Get, _Post, _Delete, _Create for PUT verb and _Update for PATCH), thats why you should check start of the string. If you want to know all generated Operation Ids, you can open http://yoursite/openapi URL, get json from it and watch on "operationId" properties.
For those wanting the behaviour similar to that of Swagger 1.2, where it groups the routes in the SwaggerUI on the first part of the route - then this worked for me: