Skip to content

Support Request, Response and User for minimal actions #33883

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

Merged

Conversation

martincostello
Copy link
Member

@martincostello martincostello commented Jun 27, 2021

PR Title

Support Request, Response and User for minimal actions

PR Description

Adds support to minimal actions for parameters of type HttpRequest, HttpResponse, and ClaimsPrincipal to be bound to the values of the Request, Response and User properties of the HttpContext respectively.

Also cleans up some typos and IDE suggestions in the RequestDelegateFactory tests.

Fixes #33870

Adds support to minimal actions for parameters of type HttpRequest,
HttpResponse, and ClaimsPrincipal to be bound to the values of the
Request, Response and User properties of the HttpContext respectively.

Also cleans up some typos in the RequestDelegateFactory tests.

Addresses dotnet#33870.
@ghost ghost added area-runtime community-contribution Indicates that the PR has been added by a community member labels Jun 27, 2021
Copy link
Member

@davidfowl davidfowl left a comment

Choose a reason for hiding this comment

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

LGTM, but will give @halter73 a chance to review.

@davidfowl davidfowl merged commit 1b819d0 into dotnet:main Jul 3, 2021
@ghost ghost added this to the 6.0-preview7 milestone Jul 3, 2021
@martincostello martincostello deleted the 33870-minimal-actions-claimsprincipal branch July 3, 2021 14:19
@davidfowl
Copy link
Member

@martincostello one thing we missed is the api explorer support

else if (parameter.CustomAttributes.Any(a => typeof(IFromServiceMetadata).IsAssignableFrom(a.AttributeType)) ||
. Right now these will show up as coming from the body isn't correct.

@martincostello
Copy link
Member Author

Good spot. Do you want me to push up a PR to amend that?

@ghost
Copy link

ghost commented Jul 7, 2021

Hi @martincostello. 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.

@davidfowl
Copy link
Member

Good spot. Do you want me to push up a PR to amend that?

Yep!

martincostello added a commit to martincostello/aspnetcore that referenced this pull request Jul 7, 2021
Fix minimal actions parameters for HttpRequest, HttpResponse and
ClaimsPrincipal being marked as body parameters by API Explorer.

Relates to dotnet#33870 and dotnet#33883.
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support ClaimsPrincipal as a parameter with minimal APIs?
4 participants