You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Docs example: copy-mode failure versus partial in-place application #239
I prepared an example with a two-operation patch: an early replacement succeeds, then a test operation fails. Separate traces check that copy mode leaves the input unchanged while in-place mode keeps the earlier write. A third covers an escaped pointer and list insertion. These intentionally different results are recorded after each operation.
This documents native behavior and does not add rollback or report the in-place behavior as a bug.
The JSON runner is my external interaction-check project. Upstream would gain no runtime dependency. Would a short runnable example fit the apply_patch documentation?
Thanks @stefankoegl. The linked PR mixed examples for several libraries, which made the request unclear. I have opened the focused docs PR #243.
It shows a successful replace followed by a failing test. Both modes raise JsonPatchTestFailed: the default copy mode leaves the input at {'value': 1}, while in_place=True retains the earlier change to {'value': 2}. The example uses jsonpatch.apply_patch directly, with no external runner or new dependency.
All 7 doctest examples in the added section pass against the current upstream code, and the Sphinx HTML build passes with warnings treated as errors.
Activity
stefankoegl commentedon Oct 26, 2026
I'm not sure if I fully understand -- the scope of the linked PR is quite extensive. However...
Most likely yes. If you could prepare a PR for the docs, we can take it from there.
PerchAnton commentedon Oct 27, 2026
Thanks @stefankoegl. The linked PR mixed examples for several libraries, which made the request unclear. I have opened the focused docs PR #243.
It shows a successful
replacefollowed by a failingtest. Both modes raiseJsonPatchTestFailed: the default copy mode leaves the input at{'value': 1}, whilein_place=Trueretains the earlier change to{'value': 2}. The example usesjsonpatch.apply_patchdirectly, with no external runner or new dependency.All 7 doctest examples in the added section pass against the current upstream code, and the Sphinx HTML build passes with warnings treated as errors.