Migrate from Newtonsoft to System.Text.Json#156
Open
EmaX093 wants to merge 2 commits intohydrostack:mainfrom
Open
Migrate from Newtonsoft to System.Text.Json#156EmaX093 wants to merge 2 commits intohydrostack:mainfrom
EmaX093 wants to merge 2 commits intohydrostack:mainfrom
Conversation
Contributor
|
Thank you for the PR! I see the biggest challange was the JsonPopulate. I think replacing well tested version from Newtonsoft would require writing comprehensive unit tests - without it we cannot be sure the new version works well in all the scenarios. |
Author
|
Totally agree! Wrote a json utility to mimic netwonsoft PopulateObject implementation (see |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WARNING: Needs thorough testing. It works perfectly on my end, but we should look out for potential edge cases
This pull request migrates the codebase from using
Newtonsoft.Jsonto the built-inSystem.Text.Jsonfor JSON serialization and deserialization throughout the project. It updates serializer settings, replaces all usages ofJsonConvertand related types with theirSystem.Text.Jsonequivalents, and adjusts code to accommodate API differences. This change reduces external dependencies and leverages the improved performance and features ofSystem.Text.Json.Migration from Newtonsoft.Json to System.Text.Json:
Newtonsoft.JsonandJsonConverthave been replaced withSystem.Text.JsonandJsonSerializer, including serializer settings and attributes such as[JsonProperty]to[JsonPropertyName].Newtonsoft.Jsonpackage reference was removed from the project.This migration streamlines JSON handling in the project, aligns with modern .NET practices, and removes a third-party dependency.