json icon indicating copy to clipboard operation
json copied to clipboard

A really simple C# JSON Parser in 350 lines

Results 15 json issues
Sort by recently updated
recently updated
newest added

This is not issue, I think it good idea if you can add https://app.quicktype.io to the Readme, it parse JSON and generate the Class, it useful for known Json and...

See the issue #47 Maybe add this functionality? With something like: `public static T FromJson(this string json, object defaultObject)`

The writer generates something like: `{"ScanDictionaries":{"..\":"a","%cd%\..\":"b"}}` instead of `{"ScanDictionaries":{"..\\":"a","%cd%\\..\\":"b"}}` FIX: In JSONWriter.cs at line 126 change `stringBuilder.Append((string)key);` to `stringBuilder.Append(((string)key).Replace("\\", "\\\\"));` In JSONParser.cs at line 243 change `string keyValue = elems[i].Substring(1,...

The parser is not compatible with nullable types (int? for example) It can be done by adding: ``` if (Nullable.GetUnderlyingType(type) != null) { return ParseValue(Nullable.GetUnderlyingType(type), json); } ``` to https://github.com/zanders3/json/blob/master/src/JSONParser.cs#L251-L252

Thanks for releasing this I've a json with a null string (returning null, not "") ![image](https://user-images.githubusercontent.com/10632326/159489091-c13b2daa-5d5b-4b41-84a7-0d50aa35bbb7.png) The parser seems to be confused because the value is {"ul"} and not {null}...

This PR adds support for nullable types. There is also a fix for a quirk causing null string values to be returned as the string "ul" instead of the actual...

Adds support for datetime (universal only => System.Globalization.DateTimeStyles.AssumeUniversal)

easy to reproduce: ``` Debug.Print(new DateTime().ToJson()); => StackOverflow ```

Given the current class ``` using System; using UnityEngine; [Serializable] public class SzVector3 { public Vector3 Value => new Vector3(x, y, z); // Buggy public float x; public float y;...

This PR adds an option to JSONWriter class for beautiful (intended) json output.