bad_json_parsers icon indicating copy to clipboard operation
bad_json_parsers copied to clipboard

.NET JSON parser methodology

Open daiplusplus opened this issue 6 years ago • 1 comments

Newtonsoft.Json can parse JSON in different ways, both with and without using a String representation and this will give you different results (e.g. a String cannot exceed 1,073,741,824 characters (due to the 2GiB single object size limit and the fact String always uses UTF-16) so that's an upper-limit when using JsonConvert.DeserializeObject<T>(String) but you should be able to read an input stream exceeding that limit using JsonTextReader and passing that into DeserializeObject.

Additionally, the first-party JSON parser that shipped with WCF 3.5 ( System.Runtime.Serialization.Json is built on the XML parser, which means it inherits the configurable nested object depth-limit - and I've seen this is not well understood in the .NET community - so just throwing that out there.

daiplusplus avatar Nov 09 '19 03:11 daiplusplus

That is very interesting, thank you! Would you be interested in adding .net to our travis CI so that we can test these two parsers?

lovasoa avatar Nov 09 '19 07:11 lovasoa