-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
✔️ Resolution: FixedThe bug or enhancement requested in this issue has been checked-in!The bug or enhancement requested in this issue has been checked-in!area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-minimal-actionsController-like actions for endpoint routingController-like actions for endpoint routing
Milestone
Description
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
Metadata
Metadata
Assignees
Labels
✔️ Resolution: FixedThe bug or enhancement requested in this issue has been checked-in!The bug or enhancement requested in this issue has been checked-in!area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-minimal-actionsController-like actions for endpoint routingController-like actions for endpoint routing
