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
This is also valid json, but running the Differ gives:
> new JsonDiffer().Differ(from, to, false)
Newtonsoft.Json.JsonReaderException : After parsing a value an unexpected character was encountered: t. Path 'path', line 1, position 33.
at Newtonsoft.Json.JsonTextReader.ParsePostValue(Boolean ignoreComments)
at Newtonsoft.Json.JsonTextReader.Read()
at Newtonsoft.Json.Linq.JContainer.ReadContentFrom(JsonReader r, JsonLoadSettings settings)
at Newtonsoft.Json.Linq.JContainer.ReadTokenFrom(JsonReader reader, JsonLoadSettings options)
at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
at Newtonsoft.Json.Linq.JObject.Parse(String json)
at JsonDiffPatch.Operation.Parse(String json)
at JsonDiffPatch.JsonDiffer.Build(String op, String path, String key, JToken value)
at JsonDiffPatch.JsonDiffer.CalculatePatch(JToken left, JToken right, Boolean useIdToDetermineEquality, String path)+MoveNext()
at JsonDiffPatch.JsonDiffer.CalculatePatch(JToken left, JToken right, Boolean useIdToDetermineEquality, String path)+MoveNext()
at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at JsonDiffPatch.JsonDiffer.Diff(JToken from, JToken to, Boolean useIdPropertyToDetermineEquality)
.
This code creates { 'op' : 'replace' , path: '/isn't', value: true} which isn't valid json at all. The only reason it doesn't fail in other cases is that JObject.Parse is generous.
The text was updated successfully, but these errors were encountered:
An example:
from:
This is valid json.
to:
This is also valid json, but running the Differ gives:
I am pretty certain the error happens in
JsonDiffPatch/JsonDiffPatch/JsonDiffer.cs
Lines 26 to 27 in dd56de0
JsonDiffPatch/JsonDiffPatch/JsonDiffer.cs
Lines 30 to 31 in dd56de0
This code creates
{ 'op' : 'replace' , path: '/isn't', value: true}
which isn't valid json at all. The only reason it doesn't fail in other cases is thatJObject.Parse
is generous.The text was updated successfully, but these errors were encountered: