-
Notifications
You must be signed in to change notification settings - Fork 10.4k
RDG array handling. #47086
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
RDG array handling. #47086
Conversation
1b8a000
to
39189b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RequestDelegateFactory
processes arrays of things only if DisableInferBodyFromParameters
is true
. This property is typically set if the request is a non-POST request (see this code). We might want to consider respecting this property here to avoid inadvertently triggering this code path for MapPost
types.
src/Http/Http.Extensions/test/RequestDelegateGenerator/RequestDelegateCreationTests.Arrays.cs
Outdated
Show resolved
Hide resolved
I don't look at processing arrays from request body at all in this PR. I'm only sourcing from either query string or headers. I can see that we need to handle the from body scenario though. I might follow this up with another PR unless you think what I've got here is unsafe even in the query string/headers scenario. |
Ah sorry, I think I misunderstood what you are talking about. Looking more closely at the MapPost behavior I can see what you mean. |
7a6f0a7
to
0d4914d
Compare
@captainsafia reacted to changes on main, but also added logic to decide when to infer parameters from body. |
src/Http/Http.Extensions/gen/StaticRouteHandlerModel/EndpointParameter.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall! We should consolidate the tests that are in RDFTests with these to make sure that we haven't missed any bugs...
src/Http/Http.Extensions/gen/StaticRouteHandlerModel/EndpointParameter.cs
Show resolved
Hide resolved
src/Http/Http.Extensions/gen/StaticRouteHandlerModel/EndpointParameter.cs
Show resolved
Hide resolved
src/Http/Http.Extensions/test/RequestDelegateGenerator/RequestDelegateCreationTests.Arrays.cs
Show resolved
Hide resolved
src/Http/Http.Extensions/gen/StaticRouteHandlerModel/EndpointParameter.cs
Show resolved
Hide resolved
Good call. I've found a few bugs in doing this around arrays of nullables. |
...st/RequestDelegateGenerator/Baselines/MapAction_ExplicitQuery_StringArrayParam.generated.txt
Show resolved
Hide resolved
src/Http/Http.Extensions/test/RequestDelegateGenerator/RequestDelegateCreationTests.Arrays.cs
Show resolved
Hide resolved
src/Http/Http.Extensions/gen/StaticRouteHandlerModel/StaticRouteHandlerModel.Emitter.cs
Show resolved
Hide resolved
src/Http/Http.Extensions/gen/StaticRouteHandlerModel/Emitters/EndpointParameterEmitter.cs
Outdated
Show resolved
Hide resolved
src/Http/Http.Extensions/gen/StaticRouteHandlerModel/Emitters/EndpointParameterEmitter.cs
Show resolved
Hide resolved
src/Http/Http.Extensions/gen/StaticRouteHandlerModel/EndpointParameter.cs
Outdated
Show resolved
Hide resolved
…arameter.cs Co-authored-by: Safia Abdalla <safia@safia.rocks>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow ups include handling DisableInferBodyFromParameters
as a runtime value and removing duplicate RDF tests.
Addresses #46785