pypi / jsonpatch
jsonpatch
What changed in jsonpatch 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-20.
9 breaking1 security6 new APIs and options2 performance3 behavior and defaults1 tooling21 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initjsonpatch 143 changes
Breaking changes 9
Python 3.10 is no longer supported.
Operations on missing locations raise JsonPatchPathNotFound.
Type stubs are now shipped as the jsonpatch-stubs package. Uninstall types-jsonpatch before upgrading because it pins jsonpatch to 1.32 and can delete jsonpatch’s own stubs when later uninstalled.
Removing from immutable containers now raises JsonPatchConflict.
Invalid patch document containers are rejected.
Rejects moving a location into its own children.
JSON diff comparison no longer treats 1 and True as equal.
Pointers can no longer index into strings.
The project supports only currently supported Python versions.
Security 1
Malformed patches and "from": "/-" raise the documented exceptions.
New APIs and options 6
Adds an opt-in JsonPatch variant for string appends.
Adds a utility function for joining paths.
Adds a utility function for splitting paths.
In-place patches can now be applied atomically as an opt-in.
JsonPatchException now exposes the failing operation as op.
Adds an option to generate test operations in diffs.
Performance 2
Finds moves without rewriting all later operations.
Patch operations are hashed by their op and path.
Behavior and default changes 3
Generated patch values are copied independently of input documents, so they no longer depend on those documents.
Supports whole-document operations on scalar documents.
Compares values using JSON equality.
Tooling 1
Type stubs now return concrete types, improving the specificity of return type information available to developers.
Fixes and other changes 21
Python 3.15 is now supported.
Test operations compare read-only containers recursively.
Fixes jsondiff/jsonpatch crashing with a raw traceback on UTF-8 BOM files.
Input files are closed after their documents are loaded.
Invalid CLI patches are rejected before the input file is modified.
Patch validation preserves one-shot operation iterators instead of consuming them.
Temporary output is cleaned up when fdopen setup fails.
In-place output is cleaned up after write errors.
JSON command-line file I/O uses UTF-8.
Move location helpers handle source pointer objects.
An in-place CLI replacement failure now preserves the original file.
Patch generation now honors optimization=False.
Closes the original input before performing an in-place replacement.
List diffing uses sequence alignment to avoid unnecessary replacements and cascading changes.
Handles self-containing values when generating a patch.
Adds support for Python 3.13 and 3.14.
Rejects '-' only when it refers to an array, rather than rejecting it in other contexts.
Fix operation reindexing for nested paths and other operation reindexing bugs in generated diffs.
Comparison ordering is deterministic, making JSON diff results consistent.
Applying patch operations no longer modifies the patch object.
Handle the whole-document pointer in the sequence branch and fix copying from that pointer.