Skip to content
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

Merged

Conversation

mitchdenny
Copy link
Member

Addresses #47239

Copy link
Member

@captainsafia captainsafia left a 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.

@mitchdenny mitchdenny force-pushed the disable-infer-body-from-parameters-support branch from 8b40fa5 to 9f4d4c6 Compare May 23, 2023 03:53
@mitchdenny mitchdenny merged commit 6c49e7b into dotnet:main May 23, 2023
}
try
{
var bodyValue = await httpContext.Request.ReadFromJsonAsync<T>();
Copy link
Member

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?

Copy link
Member

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

Copy link
Member

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.

@amcasey amcasey added area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc and removed area-runtime labels 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-rdg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants