json-patch-php
json-patch-php copied to clipboard
Incorrect working during patches creation
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