-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
Priority:1Work that is critical for the release, but we could probably ship withoutWork that is critical for the release, but we could probably ship withoutapi-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-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
Minimal APIs currently don't populate any value for the ApiDescriptor.GroupName property. We should add support for setting the group name via endpoint metadata and flowing that through to the ApiDescriptor, e.g.:
app.MapGet("/myapi/do-the-thing", () => "done!")
.WithGroupName("v1");
// Psuedo-spec
public static IEndpointConventionBuilder WithGroupName(this IEndpointConventionBuilder builder, string groupName)
{
builder.WithMetadata(new EndpointGroupNameMetadata(groupName));
}
// Attribute for declarative scenario
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Delegate, Inherited = false, AllowMultiple = false)]
public sealed class EndpointGroupNameAttribute: Attribute, IEndpointGroupNameMetadata;Setting it by default
Swashbuckle currently uses ApiDescriptor.GroupName in its default API inclusion predicate in such a way that if we were to set a default value that doesn't match the configured Swagger document name, the APIs would not be included by default. For that reason it seems like we shouldn't set a default value for ApiDescriptor.GroupName unless we also update the Swashbuckle logic.
Metadata
Metadata
Assignees
Labels
Priority:1Work that is critical for the release, but we could probably ship withoutWork that is critical for the release, but we could probably ship withoutapi-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-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