Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
JsonSerializerOptions.AddContext won't make the options read-only anymore (dotnet/runtime#80527) and the following code must be updated to add context to combine with the current one.
|
if (options.SerializerOptions.IsReadOnly) |
|
{ |
|
options.SerializerOptions = new(options.SerializerOptions); |
|
} |
|
|
|
// Combine the current resolver with our internal problem details context |
|
options.SerializerOptions.TypeInfoResolver = JsonTypeInfoResolver.Combine(options.SerializerOptions.TypeInfoResolver!, ProblemDetailsJsonContext.Default); |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
JsonSerializerOptions.AddContext won't make the options read-only anymore (dotnet/runtime#80527) and the following code must be updated to add context to combine with the current one.
aspnetcore/src/Http/Http.Extensions/src/ProblemDetailsJsonOptionsSetup.cs
Lines 16 to 22 in e523876