Closed
Description
Describe the bug
If WithGroupName(string)
is used with a Minimal APIs endpoint, it disappears from being displayed in OpenAPI.
Using WithGroupName()
No WithGroupName()
To Reproduce
Create an empty ASP.NET Core 6 project with a reference to Swashbuckle.AspNetCore
with the below code as Program.cs
.
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen(options =>
{
options.SwaggerDoc("v1", new() { Title = builder.Environment.ApplicationName, Version = "v1" });
});
var app = builder.Build();
app.MapGet("/greeting", () => "Hello, world")
.WithGroupName("Greetings");
app.UseSwagger();
app.UseSwaggerUI(options =>
{
options.EnableTryItOutByDefault();
options.SwaggerEndpoint("/swagger/v1/swagger.json", $"{builder.Environment.ApplicationName} v1");
});
app.Run();
Further technical details
.NET SDK version 6.0.100-rc.1.21460.8