Applies an RFC 6902 JSON Patch to document, returning the new value.
The input is not mutated; a clone is patched and returned. Operating on the
root pointer ("") replaces / adds the whole document.
Apply is intentionally lenient to keep streaming robust: applying an add /
replace whose parent container is missing initializes the parent as an
object, and a remove / replace targeting a missing member is a no-op
rather than an error. test operations are honored and throw on mismatch.
Applies an RFC 6902 JSON Patch to
document, returning the new value.The input is not mutated; a clone is patched and returned. Operating on the root pointer (
"") replaces / adds the whole document.Apply is intentionally lenient to keep streaming robust: applying an
add/replacewhose parent container is missing initializes the parent as an object, and aremove/replacetargeting a missing member is a no-op rather than an error.testoperations are honored and throw on mismatch.