mailjet-apiv3-dotnet icon indicating copy to clipboard operation
mailjet-apiv3-dotnet copied to clipboard

Can the old Newtonsoft be replaced by System.Text.Json?

Open mc0re opened this issue 4 years ago • 6 comments

.NET Core 3 comes with a new JSON parser. I really don't want to use Newtonsoft alongside with it. Is there an API with e.g. a string instead of JObject?

mc0re avatar Aug 07 '20 20:08 mc0re

Hi @mc0re Could you explain a bit, do you want to have SDK API that has a more typed interface rather than using JObject, or do you want to eliminate internal dependency to the Newtonsoft json at all?

goacoustic avatar Oct 15 '20 14:10 goacoustic

I'd rather see Newtonsoft dependency abstracted away or eliminated, so the 3.1 projects do not need to have both Newtonsoft and System.Text included. Some types in the two libraries have the same names, and there could be other dependency clashes.

But if that proves difficult, then at least eliminate Newtonsoft on the interface layer.

mc0re avatar Oct 15 '20 18:10 mc0re

Both options are really tough, as the first one require changing targets to .net standart 2.0/.net 4.6.2, and the second one requires changing interface of the sdk wrapper. For now seems like "nice to have" feature, but anyway worth considering.

goacoustic avatar Oct 15 '20 20:10 goacoustic

Actually, the 1-st one includes the 2-nd :-) So start with the 2-nd, when you're up to it ;-)

mc0re avatar Oct 15 '20 20:10 mc0re

I would also appreciate this being brought up to System.Text.Json in preference to Newtonsoft, as well as re-targeting to .NET Standard 2.0 instead of 1.1.

OvenBaker avatar Nov 30 '21 14:11 OvenBaker