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

Add an option to use System.Text.Json instead of NewtonsoftJson #2777

Open
j-mok opened this issue Mar 28, 2024 · 0 comments
Open

Add an option to use System.Text.Json instead of NewtonsoftJson #2777

j-mok opened this issue Mar 28, 2024 · 0 comments

Comments

@j-mok
Copy link
Contributor

j-mok commented Mar 28, 2024

I'm wondering if there is currently any particular reason the platform uses NewtonsoftJson instead of the now-default System.Text.Json for ASP.NET MVC? Are there any particular customizations that would be difficult to pull of with System.Text.Json. PolymorphJsonContractResolver maybe?

I think it would be beneficial to allow VC instances to optionally use the default serializer. This has a number of advantages:

  • System.Text.Json tends to be faster
  • C# 11's required keyword is supported by System.Text.Json and helps in model validation
  • There are some promising source-generation techniques available with System.Text.Json that could help improve cold-start times in the AOT fashion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant