Like JSON Pointer, except that it:
application/json
content typeGiven the following JSON document:
{
"foo": 23,
"bar": "hello",
"baz": {
"quux": true,
"bang": [7, "wow", {"yello": "dello"}],
"pow": [
{
"a": 3,
"b": "yes"
},
{
"a": 5,
// notice: no "b"
"c": "no"
}
]
}
}
and this corresponding JSON batch pointer:
[
"foo", // select "foo" from the root document
{
"baz": [
"quux", // like JSON Pointer "/baz/quux"
{
// grab indexes 1 and 2 out of an array, also the length of the array
"bang": [1, "2", "length"],
// grab items "a" and "b" out of each element in this array
"pow": [["a", "b"]]
}
]
},
"nonexistent" // target document doesn't have this key
]
one can expect the following extraction:
{
"foo": 23,
"baz": {
"quux": true,
// "bang" is treated as though it was an object rather than an array
"bang": {
"1": "wow",
"2": {"yello": "dello"},
"length": 3
},
"pow": [
{
"a": 3,
"b": "yes"
},
{
"a": 5
// no "b" here because it wasn't present in the target document
}
]
}
// no "nonexistent" here because it wasn't present in the target document
}
More detailed, specification-like documentation TODO.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close