feat(std/json-patch): MergePatch with the RFC 7396 apply #692
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/687-merge-patch"
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?
Step 3 of #81 (the last one): RFC 7396 JSON Merge Patch in
std/json-patch.MergePatch(std/json-patch/src/merge.trb, exported fromlib.trb) wraps a patchJsonValue;apply(target): JsonValuefollows RFC 7396 section 2 (non-object patch replaces,nulldeletes, object patch merges recursively, non-object target counts as{}). It cannot fail.Encode/DecodelikeJsonPatch.tests/merge.test.trb: the 15 cases of appendix A, plus array replace, nestednulldelete,nullfor a missing member, non-object member, untouched target, round trip.docs/standard-library/json-patch.md(summary 197 chars), index andskills/regenerated; ROADMAP row and paragraph say both RFCs are done.Checked locally with the nightly
torb:format --check, the new test file (25 passed),docs index/declarations/skill,docs source std/json-patch/src. No seed change.Closes #687
std/json-patch(step 3 of #81) #687Checklist (head
9f1b244):merge.test.trbcovers the 15 RFC 7396 appendix A cases plus array replace, nested null delete, null for a missing member, non-object member, untouched target, round trip and decode errors. CI green on this head (tier A, bootstrap, pdisc, playground, gates).MergePatch.apply(merge.trb) matches the RFC section 2 pseudo-code: a non-object patch replaces, a non-object target counts as{}, null deletes, other members recurse, and a null already in the target is kept (case 13). The target is a value and is not mutated.MergePatchexported fromstd/json-patch.skills/copies regenerated, ROADMAP updated; pdisc check green.Non-blocking: none.