algesten/jsondiff — Issue #3: Delete null from middle of array produces bad diff
Author: deverton
Created: 2011-11-30 02:21:52+00:00
State: open

Actually, any object type (null, array, object) being deleted from the middle of an array triggers this one.

````java
@Test
public void testArrayObjectsWithNullAndChanges() {

String from = "{\"a\":[{\"c\":2,\"d\":3},null,{\"c\":2,\"d\":3}]}";
String to = "{\"a\":[{\"c\":2,\"d\":3},{\"c\":2,\"d\":7}]}";
String diff = "{\"-a[2]\":0,\"~a[2]\":{\"-d\":0},\"~a[1]\":{\"d\":7}}";

String d = JsonDiff.diff(from, to);
Assert.assertEquals(diff, d);

String p = JsonPatch.apply(from, diff);
Assert.assertEquals(to, p);

}
````