Repository navigation
Document whole-document results and root replacement - #240
Merged
stefankoegl merged 1 commit intoOct 26, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The documentation and examples match existing behavior, with no unresolved review findings or runtime changes.
No open issues 🎉
What changed in this PR
This documentation-only PR updates the API reference and tutorial to reflect existing support for whole-document operations on arrays and scalar JSON values. No runtime behavior changes.
Changes:
- Broaden document and result descriptions beyond dictionaries.
- Explain why callers must use the returned value after root replacement, including with
in_place=True. - Add object-to-array, empty-key, and null-to-boolean examples.
| File | Description |
|---|---|
jsonpatch.py |
Update API docstrings for supported document types and root-replacement return behavior. |
doc/tutorial.rst |
Explain whole-document replacement and distinguish the empty pointer from an empty object key. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The API reference still describes documents and results as dictionaries, although whole-document operations now support arrays and scalar JSON values (#219). The tutorial also does not explain that replacing the root returns a new value even with
in_place=True.Document the supported value shapes, show an object-to-array root replacement, and explain why callers must use the return value. Include the distinction between the empty pointer and an empty object key, plus a null-to-boolean example. No runtime behavior changes.
Validation on Python 3.12: all 8 prompts in the new tutorial section execute successfully; source-module doctests pass; Sphinx 9.1.1 HTML builds with warnings treated as errors.
git diff --checkpasses.Prepared with OpenAI Codex; the examples and documentation build were run locally.