Describe the bug
If a minimal action is configured with a display name, then the configured display name does not flow through to the ApiDescription associated with the action.
To Reproduce
Configure an endpoint action similar to the below:
builder.MapGet("/denied", () => Results.Redirect("/?denied=true"))
.WithDisplayName("DENIED");
Then inspect the ApiDescription in the debugger, such as with the DocInclusionPredicate() when using AddSwaggerGen():
builder.Services.AddSwaggerGen(options =>
{
options.SwaggerDoc("v1", new OpenApiInfo { Title = "API", Version = "v1" });
options.DocInclusionPredicate(
(_, description) => description.RelativePath?.StartsWith("api/", StringComparison.Ordinal) == true);
});
The ApiDescription.DisplayName property is null.

In the above example, the value is expected to be "DENIED".
Further technical details
- ASP.NET Core
6.0.0-preview.7.21325.3
- .NET SDK
6.0.100-preview.7.21330.1
- Visual Studio 2022 17.0.0 Preview 1.1
Describe the bug
If a minimal action is configured with a display name, then the configured display name does not flow through to the
ApiDescriptionassociated with the action.To Reproduce
Configure an endpoint action similar to the below:
Then inspect the
ApiDescriptionin the debugger, such as with theDocInclusionPredicate()when usingAddSwaggerGen():The
ApiDescription.DisplayNameproperty isnull.In the above example, the value is expected to be
"DENIED".Further technical details
6.0.0-preview.7.21325.36.0.100-preview.7.21330.1