json-patch-php icon indicating copy to clipboard operation
json-patch-php copied to clipboard

Incorrect working during patches creation

Open Dimona opened this issue 8 years ago • 0 comments

If you had value with type array in source array, then you try to change it to null it will create incorrect patches and it this is accompanied by many warnings. example fld: ['a' => 1, 'b' => 2] target fld = null

result: array (size=2) 0 => array (size=2) 'op' => string 'remove' (length=6) 'path' => string '/fld/a' (length=31) 1 => array (size=2) 'op' => string 'remove' (length=6) 'path' => string '/fld/b' (length=32)

ER: result: array (size=1) 0 => array (size=2) 'op' => string 'replace' (length=6) 'path' => string '/fld' (length=31) 'value' => null

Dimona avatar May 02 '17 10:05 Dimona