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
// result is empty arrayvarresult= JsonConvert.DeserializeObject("[");// Newtonsoft.Json.JsonReaderException: 'Error reading JArray from JsonReader. Path '', line 1, position 1.'varjarray= JArray.Parse("[");
Expected behavior
JsonConvert.DeserializeObject() throws an error on single opening bracket input.
Actual behavior
JsonConvert.DeserializeObject() successfully deserializes a single opening bracket input to an empty array.
…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).
Steps to reproduce
Expected behavior
JsonConvert.DeserializeObject()
throws an error on single opening bracket input.Actual behavior
JsonConvert.DeserializeObject()
successfully deserializes a single opening bracket input to an empty array.Version
Tested with
12.0.1
.Related Issues
#1321
The text was updated successfully, but these errors were encountered: