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
If one wants to do this at a Controller / Class level, the following is a very useful extract from here
use the [ApiExplorerSettings(GroupName = "Group")] on your controllers
Then in Startup
services.AddSwaggerGen(options =>
{
options.SwaggerDoc(version,
new Info
{
Title = name,
Version = version
}
);
options.DocInclusionPredicate((_, api) => !string.IsNullOrWhiteSpace(api.GroupName));
options.TagActionsBy(api => api.GroupName);
});
Also note that
5.0.0-beta of swashbuckle now includes an TagActionsBy overload that supports returning an array of tags. This should allow for the above customizations to be simplified