System.text.json VS Newtonsoft.json

Why a new JSON serializer?

What is the new JSON serializer missing?

[DataMember]
https://michaelscodingspot.com/the-battle-of-c-to-json-serializers-in-net-core-3/

This sample sets ReferenceLoopHandling to Ignore so that looping values are excluded from serialization instead of throwing an exception.

string json = JsonConvert.SerializeObject(foo, Formatting.Indented, new JsonSerializerSettings
{
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
});
https://github.com/dotnet/runtime/issues/29900#issuecomment-576895618
dynamic p = JsonSerializer.Parse(json, typeof(ExpandoObject));

Conclusion

--

--

Freelance Software Engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store