-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Closed
Labels
kind: questionstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updatedthe issue has not been updated in a while and will be closed automatically soon unless it is updated
Description
Hello,
I need to generate a patch like the one from merge_patch example :
// the patch
json patch = R"({
"title": "Hello!",
"phoneNumber": "+01-123-456-7890",
"author": {
"familyName": null
},
"tags": [
"example"
]
})"_json;
Is there an existing function to generate this ?
I tried diff function but it create a list of actions to apply, so not what I need.
I search somthing working like this:
// the source document
json source = R"(
{
"baz": "qux",
"foo": "bar"
}
)"_json;
// the target document
json target = R"(
{
"baz": "boo",
"hello": [
"world"
]
}
)"_json;
// create the patch
json patch = json::diff(source, target);Where patch will be
{
"baz": "boo",
"foo": null,
"hello": [
"world"
]
}
Thank you for your help.
Metadata
Metadata
Assignees
Labels
kind: questionstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updatedthe issue has not been updated in a while and will be closed automatically soon unless it is updated