我想在Swagger中更改控制器的名称.
我正在使用.NET 5、Swashback AspNetCore v6.3.1,并具有以下启动代码:
public void ConfigureServices(IServiceCollection services)
{
// code omitted for brevity
services.AddSwaggerGenNewtonsoftSupport();
services.AddSwaggerGen(x => x.EnableAnnotations());
}
控制器:
[Route("v1/taggroups")]
[ApiController]
public class ProfileGroupTypesController : ControllerBase
{
[HttpPost]
[SwaggerOperation(OperationId = "Add Tag Group", Tags = new[] { "TagGroups" })]
public IActionResult CreateProfileGroupType([FromBody] CreateProfileGroupTypeRequest request)
{
}
}
它似乎工作得很好,但我仍然可以在Swagger中看到旧控制器名称下没有列出任何内容:
如何从Swagger中删除旧的控制器名称?