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

Remove JsonSerializerOptions copy in ProblemDetailsJsonOptionsSetup #46143

Closed
1 task done
brunolins16 opened this issue Jan 18, 2023 · 0 comments · Fixed by #46716
Closed
1 task done

Remove JsonSerializerOptions copy in ProblemDetailsJsonOptionsSetup #46143

brunolins16 opened this issue Jan 18, 2023 · 0 comments · Fixed by #46716
Assignees
Labels
area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone

Comments

@brunolins16
Copy link
Member

brunolins16 commented Jan 18, 2023

Is there an existing issue for this?

  • I have searched the existing issues

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);

@brunolins16 brunolins16 added the area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels label Jan 18, 2023
@brunolins16 brunolins16 self-assigned this Jan 18, 2023
@rafikiassumani-msft rafikiassumani-msft added this to the 8.0-preview2 milestone Jan 19, 2023
@brunolins16 brunolins16 linked a pull request Feb 6, 2023 that will close this issue
@ghost ghost locked as resolved and limited conversation to collaborators Mar 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Projects
No open projects
Status: Done
4 participants
@captainsafia @brunolins16 @rafikiassumani-msft and others