NetCoreForce icon indicating copy to clipboard operation
NetCoreForce copied to clipboard

Migrate from Newtonsoft.Json to System.Text.Json

Open anthonyreilly opened this issue 4 years ago • 4 comments

Newtonsoft.Json is effectively a legacy library, now that .NET has updated it's native JSON support, migration for performance and support reasons would probably be a good idea.

https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to?pivots=dotnet-core-3-1

anthonyreilly avatar Feb 11 '21 22:02 anthonyreilly

Currently no direct replacement for DefaultContractResolver, may need custom implementation https://github.com/dotnet/runtime/issues/31257

anthonyreilly avatar Feb 12 '21 16:02 anthonyreilly

any update on this now that System.Text.Json has more features? Custom Contracts can be defined. https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/custom-contracts

jmbryan4 avatar Aug 30 '23 21:08 jmbryan4

Thanks for the link - I was waiting for something like that to be added. I'll check it out and see if it will work - I've wanted to migrate away from the old JSON library for a while now.

anthonyreilly avatar Aug 30 '23 21:08 anthonyreilly

Hi @anthonyreilly - Do you think you can get this implemented now that .NET 8.0 is out?

By the way, thank you so much for your work with this library.

TonyValenti avatar Dec 29 '23 18:12 TonyValenti