Skip to content

Commit 07229be

Browse files
committed
fixed BuildDictionary in JsonDeserializer to add all elements from the JsonArrays
1 parent a13238c commit 07229be

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

RestSharp/Deserializers/JsonDeserializer.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,13 @@ private IDictionary BuildDictionary(Type type, object parent)
107107
}
108108
else
109109
{
110-
foreach (var element in (JsonArray)child.Value)
110+
item = (IList)Activator.CreateInstance(valueType);
111+
foreach (var jArray in (JsonArray)child.Value)
111112
{
112-
item = ConvertValue(valueType, element);
113+
foreach (var element in (IList)ConvertValue(valueType, jArray))
114+
{
115+
((IList)item).Add(element);
116+
}
113117
}
114118
}
115119
dict.Add(key, item);

0 commit comments

Comments
 (0)