-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
Needs: DesignThis issue requires design work before implementating.This issue requires design work before implementating.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 withoutarea-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
Rather than having to manually specify the endpoint metadata associated with describing the response types a minimal API produces, it would be preferable to have these details automatically added based on what the minimal API actually does (its implemention) and/or by some convention based on how it's declared.
- For anonymous delegates, the name could be automatically set via a convention based on which HTTP verb it responds to, the path it's mapped to, and the parameters it accepts from the request, e.g.
app.MapGet("/hello/{name}", (string name) => $"Hello {name}");might get an auto-generated name ofGetHelloByName. - For
IResultreturning endpoint delegates, the status codes, content types, and response types the endpoint returns could be determined by analyzing the method body implementation and detecting the return paths and determining the specific details of what theIResultdoes when executed, e.g. by annotations on theIResult-implementing type itself, or some other mechanism - The discovered details could be written to a source-generated manifest that is embedded in the project assembly and discovered at application startup automatically (e.g. via an
IHostingStartup&IStartupFilter) and is then used to match the details with the registered endpoints.
This is scoped to post-.NET 6 at this time, but could potentially be delivered before .NET 7 if it only involves an update in the tooling/SDK rather than an update in the ASP.NET Core shared framework.
agilenut, cfbao, ddweber, IGx89, saithis and 2 more
Metadata
Metadata
Assignees
Labels
Needs: DesignThis issue requires design work before implementating.This issue requires design work before implementating.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 withoutarea-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