-
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
Adding Http(Request/Response) extension methods overloads accepting non-generic JsonTypeInfo #45568
Comments
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
Thanks for contacting us. We're moving this issue to the |
API Review Notes:
API Approved as proposed! |
It throws, which is consistent with the generic overloads and how null arguments are treated in non-nullable parameter types. Generally speaking, a source generated context might not include metadata for |
Background and Motivation
STJ introduced new overloads (dotnet/runtime#77051) with untyped
JsonTypeInfo
, however,HttpResponse
andHttpRequest
extension methods only supportJsonTypeInfo<T>
.As part of the work to make ASP.NET Core AOT-friendly, we have a need of those methods available. As an example, RDF needs to write the JSON response based on the runtime type and cannot create a typed
JsonTypeInfo<T>
.aspnetcore/src/Http/Http.Extensions/src/RequestDelegateFactory.cs
Line 2261 in 63d2fb0
Same for the
uController
source generator rely on theHttpResponse
extensions to write a JSON content and might not be able to have a genericJsonTypeInfo
.https://github.com/davidfowl/uController/blob/86fe16e634bdc34e641c3d983a3f26bba80ccebe/GeneratedOutput/RouteBuilderExtensions.g.cs#L504
Proposed API
Usage Examples
Alternative Designs
No response
Risks
No response
cc @eiriktsarpalis
The text was updated successfully, but these errors were encountered: