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 Newtonsoft.Json Dependency #1064

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Conversation

EjPlatzer
Copy link
Contributor

Prior to .NET Core, there was no support for JSON serialization/deserialization in the C# standard library. Therefore, it was standard practice to use an external JSON library, and 360 used the most popular and well known of these, Newtonsoft.Json.

However, Microsoft added the System.Text.Json library in the early versions of .NET Core, which was built from the ground up to be significantly more performant and standards-compliant than Newtonsoft.Json and is now feature-complete enough that it ships as the default JSON serialization/deserialization library for ASP.NET Core.

Newtonsoft.Json is gradually becoming less viable as a dependency, and continuing to depend on it complicates our environment as well as increasing our security surface. I have therefore replaced it with System.Text.Json. I verified that serialization and deserialization are handled identically, after tweaking some of the defaults as necessary. There may be potential edge cases, but that is unlikely since our use of Newtonsoft.Json was very simple.

@EjPlatzer EjPlatzer self-assigned this Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant