-Added support for deserializing to JToken
-Improved circular reference error message with type name
This commit is contained in:
@@ -498,7 +498,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
if (JsonTypeReflector.GetJsonArrayAttribute(t) != null)
|
||||
return CreateArrayContract(t);
|
||||
|
||||
if (t.IsSubclassOf(typeof(JToken)))
|
||||
if (t == typeof(JToken) || t.IsSubclassOf(typeof(JToken)))
|
||||
return CreateLinqContract(t);
|
||||
|
||||
if (CollectionUtils.IsDictionaryType(t))
|
||||
|
||||
@@ -214,7 +214,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
switch (referenceLoopHandling.GetValueOrDefault(Serializer.ReferenceLoopHandling))
|
||||
{
|
||||
case ReferenceLoopHandling.Error:
|
||||
throw new JsonSerializationException("Self referencing loop");
|
||||
throw new JsonSerializationException("Self referencing loop detected for type '{0}'.".FormatWith(CultureInfo.InvariantCulture, value.GetType()));
|
||||
case ReferenceLoopHandling.Ignore:
|
||||
return false;
|
||||
case ReferenceLoopHandling.Serialize:
|
||||
|
||||
Reference in New Issue
Block a user