Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/LitJson/JsonMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ private static void WriteValue (object obj, JsonWriter writer,
if (obj is IDictionary) {
writer.WriteObjectStart ();
foreach (DictionaryEntry entry in (IDictionary) obj) {
writer.WritePropertyName ((string) entry.Key);
writer.WritePropertyName (entry.Key.ToString());
WriteValue (entry.Value, writer, writer_is_private,
depth + 1);
}
Expand Down
4 changes: 2 additions & 2 deletions test/JsonMapperTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,12 @@ public void ExportDictionaryTest ()
hash.Add ("product", "ACME rocket skates");
hash.Add ("quantity", 5);
hash.Add ("price", 45.95);
hash.Add (1L, "Cast long to string");

string expected = "{\"product\":\"ACME rocket skates\"," +
"\"quantity\":5,\"price\":45.95}";
"\"quantity\":5,\"price\":45.95,\"1\":\"Cast long to string\"}";

string json = JsonMapper.ToJson (hash);

Assert.AreEqual (expected, json);
}

Expand Down