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

Switch to System.Text.Json #89

Merged
merged 2 commits into from
Sep 23, 2024
Merged

Conversation

drasticactions
Copy link
Contributor

This pull request makes several changes to allow supporting NativeAOT and trimming.

  • Remove Newtonsoft.JSON and replace it with the build-in System.Text.Json
  • Use JsonSourceGeneration to handle serialization/deserialization
    Remove the netcore3.0 and net7.0 targets, as they are both unsupported runtimes. Netstandard2.0 should be able to cover those runtimes if someone still uses them.
  • Update the tests to reflect switching to System.Text.Json

System.Text.Json makes changes to how it handles encoding Unicode values that would break trying to directly compare the literal strings between the input and output, even though when read back into a JSON Parser, it will read fine. So I changed the tests to compare the objects when reparsed rather than compare the strings, as they would require relaxing encoding checks. Even if the literal strings are not the same, they represent the same values in a safe way that should work cross-platform.

@DanRigby DanRigby merged commit 11f5f90 into DanRigby:main Sep 23, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants