]> git.ipfire.org Git - thirdparty/json-c.git/commit
json_patch: add first implementation only with patch application
authorAlexandru Ardelean <ardeleanalex@gmail.com>
Sat, 24 Apr 2021 14:00:13 +0000 (17:00 +0300)
committerEric Hawicz <erh+git@nimenees.com>
Tue, 1 Aug 2023 02:18:01 +0000 (22:18 -0400)
commit538b0468847660d52191ad202edb4ab585b6fd19
tree7c57bf1ed80b381570d65764db5f7c6747f44571
parente4d9fbd52a56ab108630647cf7992be5c73a37a6
json_patch: add first implementation only with patch application

Initially I wanted to also do a function that generates the JSON patch from
two JSON documents, but even just applying the JSON patch was a bit of
work, especially when needing to satisfy all the test-cases.

This change defines all the operation in the RFC6902. The addition isn't
too big (for the json_patch_apply() function), as part of the heavy lifting
is also done by JSON pointer logic.

All the ops were tested with the test-cases defined at:
  https://github.com/json-patch/json-patch-tests

RFC6902: https://tools.ietf.org/html/rfc6902

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
CMakeLists.txt
json-c.sym
json.h.cmakein
json_patch.c [new file with mode: 0644]
json_patch.h [new file with mode: 0644]