Repository navigation
Comparing changes
Open a pull request
base repository: stefankoegl/python-json-patch
base: v1.44
head repository: stefankoegl/python-json-patch
compare: v1.45
- 15 commits
- 7 files changed
- 3 contributors
Commits on Sep 1, 2025
-
feat: Add optional append operation for efficient string concatenation
- Add new `append` operation as an optional extension to RFC 6902 - Introduce `use_append_ops` parameter to enable/disable append operations - Support automatic detection of string append scenarios in make_patch() - Maintain full backward compatibility with RFC 6902 by default - Enable optimized notation for consecutive append operations in streaming The append operation is disabled by default to maintain RFC 6902 compliance. Users can opt-in by setting use_append_ops=True in apply_patch(), make_patch(), and JsonPatch methods. This feature is particularly useful for chat applications and streaming scenarios where text is appended incrementally, reducing payload size by ~2.8x compared to replace operations.
Configuration menu - View commit details
-
Copy full SHA for 2e0c8bb - Browse repository at this point
Copy the full SHA 2e0c8bbView commit details
Commits on Nov 6, 2026
-
Configuration menu - View commit details
-
Copy full SHA for f91c14e - Browse repository at this point
Copy the full SHA f91c14eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d04d21 - Browse repository at this point
Copy the full SHA 0d04d21View commit details -
Configuration menu - View commit details
-
Copy full SHA for 128d010 - Browse repository at this point
Copy the full SHA 128d010View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1014d15 - Browse repository at this point
Copy the full SHA 1014d15View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4461e2e - Browse repository at this point
Copy the full SHA 4461e2eView commit details -
Add path_split and path_join utility functions
Convert between the path of an operation (a JSON Pointer string) and its unescaped parts, so that users can inspect the keys a patch refers to, or build paths for hand-written patches, without re-implementing the escaping rules. path_split returns a tuple of strings (array indices are not converted to ints, as only the document tells whether a part is an index). path_join accepts strings and ints. Both take an optional pointer_cls, like the other public functions. Refs #95 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzphboJ9XrLY2h8AJ9iN
Configuration menu - View commit details
-
Copy full SHA for ae5db24 - Browse repository at this point
Copy the full SHA ae5db24View commit details -
Write diff paths in the syntax of pointer_cls
JsonPatch.from_diff and make_patch accepted a pointer_cls, but always wrote RFC 6901 paths and then parsed them with pointer_cls. A pointer class with another path syntax therefore produced patches that could not be applied, even to the source document. DiffBuilder now writes paths with path_join(parts, pointer_cls). This covers the use case of #189 (other path styles in generated patches) without a separate path_join argument that would have to be kept in sync with pointer_cls. path_join no longer uses JsonPointer.from_parts, which always builds an RFC 6901 string and parses it with pointer_cls. Instead it sets the parts of a pointer_cls instance and returns its path, so a pointer class with another syntax only has to override __init__ and path. JsonPointer itself keeps the previous fast path. Refs #95, #189 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzphboJ9XrLY2h8AJ9iN
Configuration menu - View commit details
-
Copy full SHA for c8e0eb8 - Browse repository at this point
Copy the full SHA c8e0eb8View commit details -
Document how to implement a custom path syntax
Add a "Custom Path Syntax" section to the tutorial. It explains which members of JsonPointer a pointer class for another syntax has to override, shows a complete example with dot-separated paths (applying, diffing, path_split / path_join and rejected keys), and how to convert such patches to standard JSON Patches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzphboJ9XrLY2h8AJ9iN
Configuration menu - View commit details
-
Copy full SHA for 5aff2d9 - Browse repository at this point
Copy the full SHA 5aff2d9View commit details -
Return proper paths from PatchOperation.path and from_path
PatchOperation.path and MoveOperation.from_path joined the parts before the key with a plain '/': without a leading '/', without escaping keys that contain '/' or '~', and ignoring the syntax of pointer_cls. For '/a~1b/0/c' they returned 'a/b/0', which is a different location. They now return the location of the parent as a path, written with path_join in the syntax of pointer_cls: '/a~1b/0' for the example above, and '' for a target at the top level, as before. This changes the result for all nested paths, e.g. 'a/0' becomes '/a/0'. Refs #95, #189 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzphboJ9XrLY2h8AJ9iN
Configuration menu - View commit details
-
Copy full SHA for be51e16 - Browse repository at this point
Copy the full SHA be51e16View commit details -
Merge pull request #171 from jeonsworld/feature/stream-chat
Add opt-in JsonPatchWithAppend for string appends
Configuration menu - View commit details
-
Copy full SHA for ee7620c - Browse repository at this point
Copy the full SHA ee7620cView commit details -
Build custom paths with from_parts, not an uninitialized pointer
path_join created a pointer_cls instance with __new__, set its parts and read its path, without calling __init__. Pointer subclasses whose path property uses state set in __init__, or whose __new__ requires the path, failed with AttributeError or TypeError. As make_patch, from_diff and PatchOperation.path use path_join, this broke them for such classes, which worked before. path_join now uses JsonPointer.from_parts, the existing class method that builds a pointer from parts, as the hook for other path syntaxes: - If pointer_cls doesn't override from_parts (or has none), path_join returns an RFC 6901 pointer without using pointer_cls, as before this branch. JsonPointer.from_parts can't be used for these classes, as it parses an RFC 6901 string with pointer_cls, which applies e.g. the prefix of a pointer class that resolves paths below a prefix. - Otherwise it returns pointer_cls.from_parts(parts).path, so the class constructs its pointers itself. Addresses the review comment on #256. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzphboJ9XrLY2h8AJ9iN
Configuration menu - View commit details
-
Copy full SHA for 98e36ed - Browse repository at this point
Copy the full SHA 98e36edView commit details
Commits on Nov 7, 2026
-
Document that get_part converts numeric object keys to ints
The docstring of PatchOperation.key said that it is an int for an array index and a str otherwise. But get_part converts every part that int() accepts, as it can't tell array indices from object keys: the object key '01' becomes 1, and '1_0' becomes 10. Document this on get_part and get_from_part, refer key and from_key to them, and point to path_split for the exact keys. The behaviour itself is unchanged, as these are existing public methods. Addresses a review comment on #256. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzphboJ9XrLY2h8AJ9iN
Configuration menu - View commit details
-
Copy full SHA for 8988679 - Browse repository at this point
Copy the full SHA 8988679View commit details
Commits on Nov 9, 2026
-
Merge pull request #256 from stefankoegl/claude/wizardly-euler-iadncx
Add path_split and path_join utility functions
Configuration menu - View commit details
-
Copy full SHA for af50e36 - Browse repository at this point
Copy the full SHA af50e36View commit details -
Configuration menu - View commit details
-
Copy full SHA for b763363 - Browse repository at this point
Copy the full SHA b763363View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v1.44...v1.45