Adding Http(Request/Response) extension methods overloads accepting non-generic JsonTypeInfo #45568
Labels
api-approved
API was approved in API review, it can be implemented
old-area-web-frameworks-do-not-use
*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone
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: