Description
a depth parameter allows to specify how deep changes should be included in the returned JSON diff.
an example:
// initial content (/test/foo) String rev0 = mk.commit("/", "+\"test\":{\"foo\":{}}", null, ""); // add /test/foo/bar String rev1 = mk.commit("/test/foo", "+\"bar\":{\"p1\":123}", null, ""); // modify property /test/foo/bar/p1 String rev2 = mk.commit("/test/foo/bar", "^\"p1\":456", null, ""); // diff with depth -1 String diff0 = mk.diff(rev0, rev2, "/", -1); // returned +"/test/foo/bar":{"p1":456} // diff with depth 5 String diff1 = mk.diff(rev0, rev2, "/", 5); // returned +"/test/foo/bar":{"p1":456} // diff with depth 1 String diff2 = mk.diff(rev0, rev2, "/", 1); // returned ^"/test/foo", indicating that there are changes below /test/foo // diff with depth 0 String diff3 = mk.diff(rev0, rev2, "/", 0); // returned ^"/test", indicating that there are changes below /test