Lines Matching refs:path

27             json op1 = R"({ "op": "add", "path": "/a/b/c", "value": "foo" })"_json;
28 json op2 = R"({ "path": "/a/b/c", "op": "add", "value": "foo" })"_json;
29 json op3 = R"({ "value": "foo", "path": "/a/b/c", "op": "add" })"_json;
38 json patch1 = R"([{ "op": "add", "path": "/a/b", "value": [ "foo", "bar" ] }])"_json;
66 json patch2 = R"([{ "op": "add", "path": "/a/b/c", "value": 1 }])"_json;
81 json patch = {{{"op", "remove"}, {"path", "/1"}}};
95 { "op": "add", "path": "/baz", "value": "qux" }
124 { "op": "add", "path": "/foo/1", "value": "qux" }
153 { "op": "remove", "path": "/baz" }
179 { "op": "remove", "path": "/foo/1" }
208 { "op": "replace", "path": "/baz", "value": "boo" }
244 { "op": "move", "from": "/foo/waldo", "path": "/qux/thud" }
278 { "op": "move", "from": "/foo/1", "path": "/foo/3" }
307 { "op": "test", "path": "/baz", "value": "qux" },
308 { "op": "test", "path": "/foo/1", "value": 2 }
328 { "op": "test", "path": "/baz", "value": "bar" }
351 { "op": "add", "path": "/child", "value": { "grandchild": { } } }
383 { "op": "add", "path": "/baz", "value": "qux", "xyz": 123 }
411 { "op": "add", "path": "/baz/bat", "value": "qux" }
440 {"op": "test", "path": "/~01", "value": 10}
471 {"op": "test", "path": "/~01", "value": "10"}
494 { "op": "add", "path": "/foo/-", "value": ["abc", "def"] }
517 // If the path is the root of the target document - the
527 { "op": "add", "path": "", "value": [1,2,3] }
553 { "op": "add", "path": "/3", "value": 3 }
586 { "op": "copy", "from": "/foo/waldo", "path": "/qux/thud" }
614 json patch = {{{"op", "replace"}, {"path", ""}, {"value", 1}}};
623 [{"op": "add", "path": "/GB", "value": "London"}]
638 // p2 = [{"op": "delete", "path": "/GB"}]
639 CHECK(p2 == R"([{"op":"remove","path":"/GB"}])"_json);
669 json patch = {{"op", "add"}, {"path", ""}, {"value", 1}};
676 json patch = {"op", "add", "path", "", "value", 1};
709 json patch = {{{"op", "foo"}, {"path", ""}}};
720 SECTION("missing 'path'")
725 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: (/0) operation 'add' must have member 'path'", json::parse_error&);
727 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: operation 'add' must have member 'path'", json::parse_error&);
731 SECTION("non-string 'path'")
734 json patch = {{{"op", "add"}, {"path", 1}}};
736 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: (/0) operation 'add' must have string member 'path'", json::parse_error&);
738 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: operation 'add' must have string member 'path'", json::parse_error&);
745 json patch = {{{"op", "add"}, {"path", ""}}};
756 json patch = {{{"op", "add"}, {"path", "/4"}, {"value", 4}}};
763 SECTION("missing 'path'")
768 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: (/0) operation 'remove' must have member 'path'", json::parse_error&);
770 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: operation 'remove' must have member 'path'", json::parse_error&);
774 SECTION("non-string 'path'")
777 json patch = {{{"op", "remove"}, {"path", 1}}};
779 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: (/0) operation 'remove' must have string member 'path'", json::parse_error&);
781 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: operation 'remove' must have string member 'path'", json::parse_error&);
788 json patch = {{{"op", "remove"}, {"path", "/17"}}};
795 json patch = {{{"op", "remove"}, {"path", "/baz"}}};
802 json patch = {{{"op", "remove"}, {"path", ""}}};
809 SECTION("missing 'path'")
814 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: (/0) operation 'replace' must have member 'path'", json::parse_error&);
816 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: operation 'replace' must have member 'path'", json::parse_error&);
820 SECTION("non-string 'path'")
823 json patch = {{{"op", "replace"}, {"path", 1}}};
825 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: (/0) operation 'replace' must have string member 'path'", json::parse_error&);
827 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: operation 'replace' must have string member 'path'", json::parse_error&);
834 json patch = {{{"op", "replace"}, {"path", ""}}};
845 json patch = {{{"op", "replace"}, {"path", "/17"}, {"value", 19}}};
852 json patch = {{{"op", "replace"}, {"path", "/baz"}, {"value", 3}}};
859 SECTION("missing 'path'")
864 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: (/0) operation 'move' must have member 'path'", json::parse_error&);
866 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: operation 'move' must have member 'path'", json::parse_error&);
870 SECTION("non-string 'path'")
873 json patch = {{{"op", "move"}, {"path", 1}}};
875 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: (/0) operation 'move' must have string member 'path'", json::parse_error&);
877 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: operation 'move' must have string member 'path'", json::parse_error&);
884 json patch = {{{"op", "move"}, {"path", ""}}};
896 json patch = {{{"op", "move"}, {"path", ""}, {"from", 1}}};
908 json patch = {{{"op", "move"}, {"path", "/0"}, {"from", "/5"}}};
915 json patch = {{{"op", "move"}, {"path", "/baz"}, {"from", "/baz"}}};
922 SECTION("missing 'path'")
927 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: (/0) operation 'copy' must have member 'path'", json::parse_error&);
929 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: operation 'copy' must have member 'path'", json::parse_error&);
933 SECTION("non-string 'path'")
936 json patch = {{{"op", "copy"}, {"path", 1}}};
938 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: (/0) operation 'copy' must have string member 'path'", json::parse_error&);
940 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: operation 'copy' must have string member 'path'", json::parse_error&);
947 json patch = {{{"op", "copy"}, {"path", ""}}};
958 json patch = {{{"op", "copy"}, {"path", ""}, {"from", 1}}};
969 json patch = {{{"op", "copy"}, {"path", "/0"}, {"from", "/5"}}};
976 json patch = {{{"op", "copy"}, {"path", "/fob"}, {"from", "/baz"}}};
983 SECTION("missing 'path'")
988 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: (/0) operation 'test' must have member 'path'", json::parse_error&);
990 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: operation 'test' must have member 'path'", json::parse_error&);
994 SECTION("non-string 'path'")
997 json patch = {{{"op", "test"}, {"path", 1}}};
999 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: (/0) operation 'test' must have string member 'path'", json::parse_error&);
1001 CHECK_THROWS_WITH_AS(j.patch(patch), "[json.exception.parse_error.105] parse error: operation 'test' must have string member 'path'", json::parse_error&);
1008 json patch = {{{"op", "test"}, {"path", ""}}};
1033 { "op": "replace", "path": "/baz", "value": "boo" },
1034 { "op": "add", "path": "/hello", "value": ["world"] },
1035 { "op": "remove", "path": "/foo"}
1071 {"op": "add", "path": "/biscuits/1", "value": {"name": "Ginger Nut"}}
1098 {"op": "remove", "path": "/biscuits"}
1119 {"op": "replace", "path": "/biscuits/0/name", "value": "Chocolate Digestive"}
1145 {"op": "copy", "from": "/biscuits/0", "path": "/best_biscuit"}
1174 {"op": "move", "from": "/biscuits", "path": "/cookies"}
1200 {"op": "test", "path": "/best_biscuit/name", "value": "Choco Liebniz"}
1220 R"( [{"op": "add", "path": "/foo", "value": "bar"}] )"_json
1224 R"( [{"op": "add", "path": "/foo", "value": "bar"}] )"_json
1228 R"( [{"op": "add", "path": "/foo/0/bar", "value": "baz"}] )"_json
1235 R"( [{"op": "remove", "path": "/foo"}] )"_json
1239 R"( [{"op": "remove", "path": "/foo/1"}] )"_json
1243 R"( [{"op": "remove", "path": "/foo/0/bar"}] )"_json
1250 R"( [{"op": "replace", "path": "/foo", "value": 1}] )"_json
1254 R"( [{"op": "replace", "path": "/foo/1", "value": 4}] )"_json
1258 R"( [{"op": "replace", "path": "/foo/0/bar", "value": 1}] )"_json
1265 R"( [{"op": "move", "from": "/foo", "path": "/bar"}] )"_json
1272 R"( [{"op": "copy", "from": "/foo/1", "path": "/bar"}] )"_json
1279 R"( [{"op": "test", "path": "/foo", "value": "bar"}] )"_json));