Open mostafahatem20 opened 3 years ago
Value-based array operations are not supported yet in JSON patch. See this issue: https://github.com/json-patch/json-patch2/issues/18 You need to remove values in an array based on index.
An example target JSON document:
{ "foo": [ "bar", "qux", "baz" ] }
A JSON Patch document:
[
{ "op": "remove", "path": "/foo/1" }
]
The resulting JSON document:
{ "foo": [ "bar", "baz" ] }
I saw in the tests how to add an attribute to the required keyword { "op": "add", "path": "/required/-", "value": "q" } but I want to ask how can i remove a keyword from being required I tried { "op": "remove", "path": "/required/-q"} but it did not work i seem to get it wrong so if anyone can help I would be grateful. Thank you