Hey Pascal,
Thanks for the response!
So the limitations I mentioned are all bugs? Are they filed in GH? I get that merging arrays might be tricky, but update and prune seem pretty straightforward. Updating / navigating to a non-existent index could return a JsError, right?
Accessing the JsArray sequence value directly isn't really a great solution in my case, as I'm trying to write generic transformers based on a JSON patch document. The patch document contains an embedded path string that may include array indices, which means that the transformation may involve navigating deep within a JSON document. For example, given the following JSON document:
{"foo": [{"bar": true}]}
One can submit a JSON patch document like:
[ {"op": "replace", "path" : "/foo/0/bar", "value" : false} ]
to yield the following transformed JSON:
{"foo" : [{"bar": false} ] }
Writing these generically using JSON transformers is basically a one-liner per operation:
Except that if the path contains an array, even if it's just selecting an element and navigating further into the document, the transformers break.
John