-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Produces and Accepts should target IEndpointConventionBuilder #43985
Comments
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
Here's a more in-depth explanation I gave in another issues filed by @commonsensesoftware for why we rejected this the first time.
|
Thanks for contacting us. We're moving this issue to the |
Any update? |
Background and Motivation
This is a continuation of #41428. I first proposed this API there, but it only got partially approved. #43675 demonstrates there are scenarios when we want to apply this kind of metadata to a group.
ProducesMetadata
, but calling an extension method on group might be more convenient for app developers.Proposed API
Usage Examples
Now you're forced to manually add attributes using
WithMetadata()
:Rather than
I don't have as concrete a scenario for adding accepts metadata to an entire group. We could consider skipping this again, but I like having both for consistency. In theory, middleware or
BindAsync
could be adding additional accepted content types to an entire group somehow. There are alternatives for types implementingBindAsync
like also implementingPopulateMetadata
, but who knows? Maybe it's too dynamic to be implemented via a static interface.Alternative Designs
IEndpointConventionBuilder
forProduces
,ProducesProblem
andProducesValidationProblem
, but notAccepts
.RouteGroupBuilder
rather thanIEndpointConventionBuilder
even though that's less extensible.Risks
These are just more extension methods that now show up in intellisense for all
IEndpointConventionBuilder
types.The text was updated successfully, but these errors were encountered: