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
When calling JsonConvert.DeserializeObject with an invalid array as input an exception should be thrown, bu this is not the case. However, JArray.Parse does throw an exception. Is there a reason why does but not the other?
Thanks,
Francisco
Steps to reproduce
obj= JsonConvert.DeserializeObject('["1",', new JsonSerializerSettings(){TypeNameHandling= TypeNameHandling.None,MaxDepth=1024});
Expected behavior
A JsonException is thrown since '["1",' is not a valid array.
Actual behavior
No exception is thrown
The text was updated successfully, but these errors were encountered:
…8377)
This is a follow up to reverted PR #8346. I removed a workaround that was used to avoid [a Newtonsoft.Json bug](JamesNK/Newtonsoft.Json#1321) that caused some incomplete json array input to successfully be deserialized.
This bug being fixed, I thought the workaround was unnecessary, but after the merge some feature tests started to fail (which I did not run prior to merging).
It was discovered that the workaround is still needed because while the first Newtonsoft.Json bug was fixed, some cases of incomplete json array input still behave unexpectedly, namely json input `[`.
This PR is just to update the comment explaining the workaround so it links to the newly created issue [here](JamesNK/Newtonsoft.Json#1930).
Hi,
When calling JsonConvert.DeserializeObject with an invalid array as input an exception should be thrown, bu this is not the case. However, JArray.Parse does throw an exception. Is there a reason why does but not the other?
Thanks,
Francisco
Steps to reproduce
Expected behavior
A JsonException is thrown since '["1",' is not a valid array.
Actual behavior
No exception is thrown
The text was updated successfully, but these errors were encountered: