Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

When did json.net add support for reading json?


Asked by Remy Rodgers on Dec 06, 2021 JSON



To add support for reading JSON a major refactor was required, and Json.NET was split into the three major classes it still uses today: JsonReader, JsonWriter and JsonSerializer. Json.NET was first released in June 2006.
Consequently,
JsonReader and JsonWriter are low-level classes and are primarily for internal use by Json.NET. To quickly work with JSON, either the serializer - Serializing and Deserializing JSON - or using LINQ to JSON is recommended. JsonTextReader and JsonTextWriter are used to read and write JSON text.
Accordingly, JSON has become an essential part of virtually all modern .NET applications and in many cases even surpassed the usage of XML. However, .NET hasn’t had a (great) built-in way to deal with JSON. Instead, we’ve relied on Json.NET until now, which continues to serve the .NET ecosystem well.
Also,
If you're using a JSON parser like JSON.NET then it can read arbitrary JSON into data so you can work with it. But the JSON seems simple to me. You have an array of items (products). Each product has a name (Product) and a set of packages associated with it.
Additionally,
If you’re having trouble adding comments to your JSON file, there’s a good reason: JSON doesn’t support comments. “I removed comments from JSON because I saw people were using them to hold parsing directives, a practice which would have destroyed interoperability,” writes Douglas Crockford , who popularized the text-based data format.