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
Successfully deserialized a Something object with property Foo equal to an empty JArray.
Actual behavior
Exception JsonSerializationException: Deserialized JSON type 'Newtonsoft.Json.Linq.JArray' is not compatible with expected type 'Newtonsoft.Json.Linq.JValue'.
Issue is new in version 13.0.1 and did not affect version 12.0.3.
Probably this is an unwanted side effect of fixing issue #2484.
The error comes from the difference between the types of the pre-initialized value of the property (null :: JValue) and the one provided in the input ([] :: JArray).
Therefore any of the following changes does not raise the exception:
removing the property initializer of Foo;
replacing the property initializer of Foo with an instance of JArray (even a non-empty one);
removing the foo property in the input;
replacing the foo property in the input with a JValue-compatible JSON snippet.
The text was updated successfully, but these errors were encountered:
Destination type
Source JSON
Expected behavior
Successfully deserialized a
Something
object with propertyFoo
equal to an emptyJArray
.Actual behavior
Exception
JsonSerializationException
: Deserialized JSON type 'Newtonsoft.Json.Linq.JArray' is not compatible with expected type 'Newtonsoft.Json.Linq.JValue'.Steps to reproduce
Observations
Issue is new in version 13.0.1 and did not affect version 12.0.3.
Probably this is an unwanted side effect of fixing issue #2484.
The error comes from the difference between the types of the pre-initialized value of the property (
null
::JValue
) and the one provided in the input ([]
::JArray
).Therefore any of the following changes does not raise the exception:
Foo
;Foo
with an instance ofJArray
(even a non-empty one);foo
property in the input;foo
property in the input with aJValue
-compatible JSON snippet.The text was updated successfully, but these errors were encountered: