Skip to content

Replace Json.NET package with System.Text.Json#92

Open
kgamecarter wants to merge 2 commits intozingz0r:masterfrom
kgamecarter:master
Open

Replace Json.NET package with System.Text.Json#92
kgamecarter wants to merge 2 commits intozingz0r:masterfrom
kgamecarter:master

Conversation

@kgamecarter
Copy link
Copy Markdown

System.Text.Json has better support for .NET NativeAOT, so I replaced JSON.NET with System.Text.Json.

@GerardSmit
Copy link
Copy Markdown
Contributor

has better support for .NET NativeAOT

Note, for NativeAOT you should also add a source generated JsonSerializerContext: https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/source-generation.
Without this the serializer/deserializer will still use reflection, which can cause the trimmer to trim parts away.

@kgamecarter
Copy link
Copy Markdown
Author

Note, for NativeAOT you should also add a source generated JsonSerializerContext: https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/source-generation.

Thx, I added CloudFlareJsonSerializerContext for NativeAOT.

@sonarqubecloud
Copy link
Copy Markdown

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