Skip to content

Latest commit

 

History

History
66 lines (35 loc) · 1.67 KB

differences.md

File metadata and controls

66 lines (35 loc) · 1.67 KB

Differences

WIP

Additions

JsonDictionaryContract.OrderByKey

JsonDictionaryContract.ShouldSerializeItem

JsonArrayContract.ShouldSerializeItem

C# union support

Unions are serialized as their active case with no wrapper and no discriminator, matching System.Text.Json. No converter or configuration is required. See Unions and closed type hierarchies.

JsonSerializerSettings.InferClosedTypePolymorphism

Writes and reads a short $type discriminator for C# closed type hierarchies, using the descendants the compiler recorded, without needing TypeNameHandling or an ISerializationBinder. See Unions and closed type hierarchies.

DateOnly and TimeOnly support

Serialized and deserialized as ISO strings with no converter required, on net6.0 and above. See Dates in JSON.

Migrating from Json.net

Nuget

Namespace

  • Remove using Newtonsoft.Json*
  • Add using Argon

XML

If using the Xml serialization features of Json.net:

  • Add Argon.Xml nuget.
  • Add using Argon.Xml
  • Add XmlNodeConverter to the JsonSerializerSettings.Converters.

Argon.DataSets

If using the DataSet serialization features of Json.net:

  • Add the Argon.DataSets nuget.
  • Call JsonSerializerSettings.AddDataSetConverters().

Argon.JsonPath

If using the JsonPath serialization features of Json.net: