1

Closed

JsonTextWriter.QuoteName = false in json.net 5.0

description

Hi, I just have found that QuoteName property seems to be ignored in Json.NET 5.0
Here's an example code:

private static void Test() {
var d = new Dictionary<string, int> {
    {"a", 1},
};
var jsonSerializerSettings = new JsonSerializerSettings {
    Formatting = Formatting.Indented,
};
var serializer = JsonSerializer.Create(jsonSerializerSettings);
using(var stringWriter = new StringWriter()) {
    using(var writer = new JsonTextWriter(stringWriter) {QuoteName = false}) {
        serializer.Serialize(writer, d);
        writer.Close();
    }
    Debug.WriteLine(stringWriter.ToString());
}
}

Run with Newtonsoft.Json.4.5.9\lib\net40\Newtonsoft.Json.dll:
{
a: 1
}

Run with Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll:
{
"a": 1
}
Closed Jul 20, 2013 at 2:29 AM by JamesNK
Fixed

comments