BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Json.NET No Longer Has over 120 Dependencies

Json.NET No Longer Has over 120 Dependencies

Json.NET is the official JSON parsing and serialization library for .NET, superseding the libraries that were actually shipped by Microsoft. However, when it came time to port it to .NET Standard, there were several problems. Aside from the numerous methods that were simply not available on that platform, Json.NET on .NET Standard 1.3 required a whopping 122 packages. With the release of Json.NET 11 for .NET Standard 2.0, those problems have been eliminated.

The huge package count is not actually the fault of Json.NET itself. Rather, it is a side effect of taking a dependency on NETStandard.Library 1.6.1, which libraries targeting .NET Standard 1.3 and earlier are dependent on.

Json.NET 11 also adds a generic JsonConverter<T>. This allows developers to create custom serialization rules for a single type without the complexity and boilerplate code needed to implement the original JsonConverter class.

Also new to this release is a UnixDateTimeConverter. This is used when dates need to be stored as an integer derived from the Unix epoch.

JSON Path Support

Unlike SQL and XPath, there is no standard for querying JSON data beyond the blog post on JSON Path from 2007. Subsequently, projects such as Json.NET have added their own extensions. Exposed via the =~ operator, Json.NET now supports regular expressions in JSON Path.

Json.NET is released by James Newton-King under the MIT License.

Rate this Article

Adoption
Style

BT