mirror of
https://github.com/nlohmann/json.git
synced 2026-10-16 03:07:12 +00:00
deploy: 4e294f4b18
This commit is contained in:
1 parent
dcc7a74a18
commit
98c9bea1d1
105 files changed
+537
-508
No files matched your search
@@ -7,7 +7,7 @@ static basic_json merge_diff(const basic_json& source,
|
||||
|
||||
Creates a [JSON Merge Patch](https://tools.ietf.org/html/rfc7396) so that value `source` can be changed into the value `target` by calling the [`merge_patch`](https://json.nlohmann.me/api/basic_json/merge_patch/index.md) function. The patch contains only what differs: changed and added members with their new values, and removed members with the value `null`. Nested objects are compared member by member; any other value that differs, including an array, is replaced as a whole.
|
||||
|
||||
For two JSON values `source` and `target`, where `target` contains no object member whose value is `null`, the following code always yields `true`:
|
||||
For two JSON values `source` and `target`, where `target` contains no object member whose value is `null`, the following code always yields `true` (for [`ordered_json`](https://json.nlohmann.me/api/ordered_json/index.md), see the notes below):
|
||||
|
||||
```
|
||||
basic_json patched = source;
|
||||
|
||||
Reference in new issue
Block a user