Skip to content

Commit 1e01833

Browse files
committed
Removed unneeded limitation for deserialization of dictionary
1 parent b15f42c commit 1e01833

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

RestSharp/Deserializers/JsonDeserializer.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -297,19 +297,11 @@ private object ConvertValue(Type type, object value)
297297

298298
if (genericTypeDef == typeof(Dictionary<,>))
299299
{
300-
Type keyType = type.GetGenericArguments()[0];
301-
302-
// only supports Dict<string, T>()
303-
if (keyType == typeof(string))
304-
{
305-
return this.BuildDictionary(type, value);
306-
}
307-
}
308-
else
309-
{
310-
// nested property classes
311-
return this.CreateAndMap(type, value);
300+
return this.BuildDictionary(type, value);
312301
}
302+
303+
// nested property classes
304+
return this.CreateAndMap(type, value);
313305
}
314306
else if (type.IsSubclassOfRawGeneric(typeof(List<>)))
315307
{

0 commit comments

Comments
 (0)