-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
DisableInferBodyFromParameters in RDG. #48269
DisableInferBodyFromParameters in RDG. #48269
Conversation
src/Http/Http.Extensions/gen/StaticRouteHandlerModel/Emitters/EndpointParameterEmitter.cs
Show resolved
Hide resolved
...DelegateGenerator/Baselines/MapPost_WithArrayQueryString_AndBody_ShouldUseBody.generated.txt
Outdated
Show resolved
Hide resolved
src/Http/Http.Extensions/test/RequestDelegateGenerator/RequestDelegateCreationTests.Arrays.cs
Outdated
Show resolved
Hide resolved
src/Http/Http.Extensions/test/RequestDelegateGenerator/RequestDelegateCreationTests.Arrays.cs
Outdated
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.
LGTM!
I think we can get away with doing the lookup per request. We do the lookup once at compile-time for RDF but I think the impact is negligible.
src/Http/Http.Extensions/gen/StaticRouteHandlerModel/Emitters/EndpointParameterEmitter.cs
Outdated
Show resolved
Hide resolved
…DelegateCreationTests.Arrays.cs Co-authored-by: Safia Abdalla <safia@safia.rocks>
…DelegateCreationTests.Arrays.cs Co-authored-by: Safia Abdalla <safia@safia.rocks>
8b40fa5
to
9f4d4c6
Compare
} | ||
try | ||
{ | ||
var bodyValue = await httpContext.Request.ReadFromJsonAsync<T>(); |
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.
@captainsafia Why aren't we passing the JSON type info here?
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.
Good catch
Context for why: #45359
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.
Context for why: #45359
Are you identifying the perf ramifications of querying the DI container for the JsonSerializerOptions to resolve the type info on every request? If so, that shouldn't be a problem here since we can cache the type info for the parameter type in the same way that we do for the response type.
Addresses #47239