Is there a way change the Controller’s name in the swagger-ui page?

Starting with ASP.NET Core 6, you can use the TagsAttribute either on Controller level:

[Tags("entity")]
[ApiController]
public class DerivedEntitiesController : ControllerBase
{

or on Action level:

[Tags("entity")]
[HttpPut("entity/{key}")]
public IActionResult PutEntity(Guid key, [FromBody] Entity entity)
{

Swagger will group according to the Tags and respect API Versioning.

Leave a Comment