[API Proposal]: STJ SystemTextJsonOutputFormatter
output type selector
#55629
Labels
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
untriaged
Background and motivation
Right now the default
SystemTextJsonOutputFormatter
internally decides what type to serialize (inWriteResponseBodyAsync
). In my case I'd like to keep the controlers response type (an Interface) that now gets broken down to it's actual class.Right now the type to serialize gets chosen here:
aspnetcore/src/Mvc/Mvc.Core/src/Formatters/SystemTextJsonOutputFormatter.cs
Line 74 in 333629e
and checked here:
aspnetcore/src/Mvc/Mvc.Core/src/Formatters/SystemTextJsonOutputFormatter.cs
Line 91 in 333629e
It'd be great to have an overrideable method where the
jsonTypeInfo
is selected.API Proposal
API Usage
Alternative Designs
No response
Risks
No response
The text was updated successfully, but these errors were encountered: