You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dynamic obj = new ExpandoObject();
obj.hello = "world";
yields: { "key": "hello", "value": "world" } and not { "hello": "world" }
The problem is this test in JsonSerializer.cs in WriteValue():
else if (_params.KVStyleStringDictionary == false && obj is IDictionary &&
obj.GetType().IsGenericType && obj.GetType().GetGenericArguments()[0] == typeof(string))
which fails since even tho ExpandoObject is a Dictionary<string, object> it is not generic (at least in Mono). I've not tried this in .NET.
There is a simple fix for this which I can PR - let me know!
The text was updated successfully, but these errors were encountered:
Serializing an ExpandoObject like:
dynamic obj = new ExpandoObject();
obj.hello = "world";
yields: { "key": "hello", "value": "world" } and not { "hello": "world" }
The problem is this test in JsonSerializer.cs in WriteValue():
else if (_params.KVStyleStringDictionary == false && obj is IDictionary &&
obj.GetType().IsGenericType && obj.GetType().GetGenericArguments()[0] == typeof(string))
which fails since even tho ExpandoObject is a Dictionary<string, object> it is not generic (at least in Mono). I've not tried this in .NET.
There is a simple fix for this which I can PR - let me know!
The text was updated successfully, but these errors were encountered: