Repository navigation
docs: explain copy and in-place behavior when a patch fails - #243
Open
PerchAnton wants to merge 1 commit into
Open
PerchAnton wants to merge 1 commit into
PerchAnton wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused documentation change accurately describes failure behavior, and no unresolved issues were identified.
No open issues 🎉
What changed in this PR
Adds the documentation follow-up discussed in #239, explaining how failed patches affect the input document in copy and in-place modes. No runtime behavior changes.
Changes:
- Adds a runnable example where a successful
replaceis followed by a failingtest. - Shows that default copy mode preserves the original document, while in-place mode retains earlier changes without rollback.
| File | Description |
|---|---|
doc/tutorial.rst |
Documents patch failure behavior with examples for both application modes. |
Review effort: Balanced
This branch has not been deployed
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.
A failed operation can leave earlier changes in the input when
in_place=True. Add a short example under “Applying a Patch” that runs the samereplacefollowed by a failingtestin both modes: the default copy mode leaves{'value': 1}unchanged, while in-place mode retains{'value': 2}.This is the small documentation follow-up invited in #239. Only
doc/tutorial.rstchanges; the example usesjsonpatch.apply_patchdirectly.Validation on upstream
f45a5001with Python 3.14.3:jsonpatch.py.sphinx-build -W --keep-going -b html doc ../docs-htmlpasses.git diff --checkpasses.Prepared with AI assistance.