Skip to content

Conversation

@rafikiassumani-msft
Copy link
Contributor

@rafikiassumani-msft rafikiassumani-msft commented Aug 24, 2021

PR Title
Add the Api Parameter Description to API Explorer to represent the request body.

PR Description
ApiExplorer should be updated to add a ApiParameterDescription to the ApiDescription to represent the incoming request body based on the details in the endpoint's IApiRequestMetadataProvider metadata if present.

API Change included.

This change adds a generic constraint (where TRequest : notnull) to a newly added API for rc1 .

namespace Microsoft.AspNetCore.Http
{
    public static class OpenApiEndpointConventionBuilderExtensions
    {
+        public static DelegateEndpointConventionBuilder Accepts<TRequest>(this DelegateEndpointConventionBuilder 
+        builder,  string contentType, params string[] additionalContentTypes) where TRequest : notnull
  }
}

Fixes #35421

@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Aug 24, 2021
@rafikiassumani-msft rafikiassumani-msft marked this pull request as draft August 24, 2021 14:32
@rafikiassumani-msft rafikiassumani-msft added old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels feature-minimal-actions Controller-like actions for endpoint routing and removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels Aug 24, 2021
@rafikiassumani-msft rafikiassumani-msft marked this pull request as ready for review August 25, 2021 01:08
@rafikiassumani-msft rafikiassumani-msft added the api-suggestion Early API idea and discussion, it is NOT ready for implementation label Aug 26, 2021
Comment on lines +133 to +134
public static DelegateEndpointConventionBuilder Accepts<TRequest>(this DelegateEndpointConventionBuilder builder,
string contentType, params string[] additionalContentTypes)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static DelegateEndpointConventionBuilder Accepts<TRequest>(this DelegateEndpointConventionBuilder builder,
string contentType, params string[] additionalContentTypes)
public static DelegateEndpointConventionBuilder Accepts<TRequest>(this DelegateEndpointConventionBuilder builder, string contentType, params string[] additionalContentTypes)

@pranavkm pranavkm removed the api-suggestion Early API idea and discussion, it is NOT ready for implementation label Aug 26, 2021
@rafikiassumani-msft rafikiassumani-msft merged commit 09f6826 into dotnet:main Aug 26, 2021
@ghost ghost added this to the 7.0-preview1 milestone Aug 26, 2021
rafikiassumani-msft added a commit to rafikiassumani-msft/aspnetcore that referenced this pull request Aug 26, 2021
…t body - 35421 (dotnet#35654)

* flow addition parameters to swagger
@rafikiassumani-msft
Copy link
Contributor Author

/backport release/6.0-rc1

@ghost
Copy link

ghost commented Aug 26, 2021

Hi @rafikiassumanimsft. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

rafikiassumani-msft added a commit that referenced this pull request Aug 27, 2021
…t body - 35421 (#35654) (#35798)

* flow additional parameters to open UI(swagger)
@amcasey amcasey added the area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc label Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc feature-minimal-actions Controller-like actions for endpoint routing 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 this pull request may close these issues.

Add Api Parameter Description to Api Description to represent the request body

3 participants