-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Add support for argument list surrogates in minimal APIs #40712
Copy link
Copy link
Closed
Labels
DocsThis issue tracks updating documentationThis issue tracks updating documentationapi-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-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 routingold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone
Metadata
Metadata
Assignees
Labels
DocsThis issue tracks updating documentationThis issue tracks updating documentationapi-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-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 routingold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Type
Fields
Give feedbackNo fields configured for issues without a type.
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
The idea here is to support using a type that can act like a surrogate for the argument list in a minimal API. The motivation is about refactoring a minimal API that takes a large set of parameters into one that takes a single object with top level properties that represent what were once arguments. This is a common pattern seen with CQRS frameworks where a request object is made to bind all inputs.
Describe the solution you'd like
The user wishes to refactor this to:
The parameter or type needs to be marked explicitly to identify that this is not from the body or elsewhere (query etc). These properties should also support binding attributes:
This would only work for top level properties in this object.
Additional context
Open questions: