I'd like to get a list of the JSON parts that don't match when doing a comparison using Newtonsoft.
I have this code that compares:
JObject xpctJSON = JObject.Parse(expectedJSON);
JObject actJSON = JObject.Parse(actualJSON);
bool res = JToken.DeepEquals(xpctJSON, actJSON);
But can't find anything that returns the diff's.
Just to help future queries. There's a nice json diff tool I came across. It works flawlessly for diff/patch of json structures:
jsondiffpatch.net There's also a nuget package for it.
usage is straightforward.
var jdp = new JsonDiffPatch();
JToken diffResult = jdp.Diff(leftJson, rightJson);