MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / jsonpatch_add_add_add_failed2

Function jsonpatch_add_add_add_failed2

examples/src/jsonpatch_examples.cpp:69–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void jsonpatch_add_add_add_failed2()
70{
71 json target = json::parse(R"(
72 { "foo": "bar"}
73 )");
74
75 json patch = json::parse(R"(
76 [
77 { "op": "add", "path": "/baz", "value": "qux" },
78 { "op": "add", "path": "/foo", "value": [ "bar", "baz" ] },
79 { "op": "add", "path": "/baz/bat", "value": "qux" } // nonexistent target
80 ]
81 )");
82
83 std::error_code ec;
84 jsonpatch::apply_patch(target, patch, ec);
85
86 std::cout << "(1) " << std::error_code(ec).message() << '\n';
87 std::cout << "(2) " << target << '\n';
88}
89
90void create_a_json_patch()
91{

Callers 1

mainFunction · 0.85

Calls 3

parseFunction · 0.85
apply_patchFunction · 0.85
messageMethod · 0.45

Tested by

no test coverage detected