I\'m using Swashbuckle to enable the use of swagger and swagger-ui in my WebApi project.
In the following image you can see two of my controllers shown in the swagger-ui
You can use tags for that. By default Swashbuckle adds a tag with the name of the controller to every operation. You can override that with the SwaggerOperationAttribute
. For instance, the next line replaces the default tag, Values, with the tag Test:
public class ValuesController : ApiController
{
[SwaggerOperation(Tags = new[] { "Test" })]
public IHttpActionResult Get()
{
// ...
}
}
The Get
operation will now be put in the group Test
.
If you want the operation to appear in multiple groups you can add more tags. For instance:
[SwaggerOperation(Tags = new[] { "Test", "Release1" })]
will put the Get
operation in the groups Test
and Release1
.