Skip to content

Allow parameter and return types of route handler delegates (API Controllers) to contribute to endpoint metadata #41421

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

Closed
1 task done
brunolins16 opened this issue Apr 28, 2022 · 2 comments · Fixed by #41635
Assignees
Labels
feature-openapi old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone

Comments

@brunolins16
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Introduce the capability for types used for parameters and return values for API controller actions to contribute to metadata of the endpoint they're mapped to. This will allow types that implement custom binding logic via TryParse and IResult types, to add metadata that describes the API parameters and responses in Swagger UI and OpenAPI documents.

This is an idea of feature parity with Minimal API, after #40646.

Describe the solution you'd like

We should introduce the same support for the new interfaces, IEndpointParameterMetadataProvider and IEndpointMetadataProvider that currently is implemented in Minimal Actions.

Additional context

No response

@brunolins16 brunolins16 added feature-openapi old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels labels Apr 28, 2022
@captainsafia captainsafia added this to the .NET 7 Planning milestone May 3, 2022
@ghost
Copy link

ghost commented May 3, 2022

Thanks for contacting us.

We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@captainsafia
Copy link
Member

Triage: Bruno proposes implementing this as an ApiConvention.

We also discussed whether this would worthwhile to do if MVC does not support BindAsync and concluded there is value in this work even though MVC doesn't support BindAsync as of writing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-openapi old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants