softwerkab / fortnox-csharp-api-sdk

.NET SDK for Fortnox API.
MIT License
52 stars 64 forks source link

Migrate from Newtonsoft.Json to System.Text.Json #166

Open vanillajonathan opened 3 years ago

vanillajonathan commented 3 years ago

Migrate from the Newtonsoft.Json package to the System.Text.Json package.

https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to

richardrandak commented 3 years ago

Hello @vanillajonathan

Can you list a few benefits for using the System.Text.Json package?

I mean, the Newtonsoft is basically a standard in .NET projects, so migrating to a less known package would likely come with potential bugs.

vanillajonathan commented 3 years ago

Newtonsoft is a very old package with over a decade of legacy, Microsoft hired the author of Newtonsoft to create System.Text.Json where he had the chance to bring all his experience yet break apart from the old design to make something better.

The benefits is using an official Microsoft package that is part of .NET (part of .NET Core 3.0, for netstandard projects here is the NuGet package). It does offer a better performance.

Microsoft has a blog article where they take up, Why System.Text.Json? Looking back at .NET Core 3.x

Newtonsoft is the past, System.Text.Json is the future of JSON on the .NET platform and ecosystem.

Julio-German-Gutierrez commented 2 years ago

Hello, I do also support System.Text.Json and had problems with exceptions because of Newtonsoft JsonConverter (I am coding in ASP.NET core 6). How can I bypass these exceptions? Is there a new version of the FortNox API that uses System.Text.Json already? The problem is basically that I can not use the FortnoxClient.CustomerConnector . Do I have to do my own implementation of ICustomerConnector? Thanks!