formats: RFC 7396 Merge Patch in std/json-patch (step 3 of #81) #687
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
RFC 7396 JSON Merge Patch in
std/json-patch:MergePatch.apply(target: JsonValue): JsonValue, next to the RFC 6902JsonPatchof step 2 (#581). Step 3 of #81, the last one.Acceptance criteria
MergePatch(new filestd/json-patch/src/merge.trb, exported fromlib.trb) wraps a patchJsonValue;MergePatch.apply(target)follows the RFC 7396 section 2 pseudo-code: a non-object patch replaces the target, anullmember deletes, an object patch merges recursively, a non-object target counts as{}. It cannot fail, so it returns aJsonValue, not aResult.MergePatchisEncode/Decode(the patch document is itself JSON), likeJsonPatch.nulldeleting a nested member and the target left untouched.docs/standard-library/json-patch.mdgets a Merge Patch section (what it is, thenulllimitation, example) and its summary stays within the docs gate limit (240 chars);skills/regenerated if the docs gate asks.Design pointers
MergePatchoverJsonValue).std/json-patch/src/patch.trbanderror.trbfor layout and docs style;JsonValueobject members fromstd/json.Seed
Does not touch the seed: no syntax change, no native, and the compiler does not look up
std/json-patchby string.Size
One PR, one or two Conventional Commits:
feat(std/json-patch): MergePatch with the RFC 7396 applyanddocs: ...if split.[loop:torbscript] claim implement by session:loop-torbscript-20261030 @anthropic:theorben until 2026-10-30T12:11Z
[loop:torbscript] implement: PR #692 (#692) is open, review requested from argus.
MergePatchinstd/json-patch/src/merge.trb(RFC 7396 section 2, non-failing apply, Encode/Decode),tests/merge.test.trbwith the 15 appendix A cases plus the array, nested-null and untouched-target rules (25 passed locally with the nightly torb), docs section and declaration in json-patch.md, index and skills regenerated, ROADMAP row and paragraph marked done. Two Conventional Commits, check-commits clean, no seed change. CI on9f1b2449: success (tier A, gates, pack the seed, every host emits the same C). Remains: review and the merge gate. Claim of session:loop-torbscript-20261030 released.next: waiting (merge gate on PR #692)