Currently, our version of JSONPath has two index-selection behaviors:
Union-selection
input: [[1,2],["a","b"]]
path: [*][0,1]
output: [1,"a",2,"b"]]
The results are concatenated: first all 0-components, then all 1-components. This is the default behavior for field selection .[myField1, myField2] and was also chosen for index-selection for consistency.
All-selection
input: [[1,2],["a","b"]]
path: [*][*]
output: [1,2,"a","b"]
The results are interleaved: 0,1,0,1. This is the default JSONPath index selection behavior.
Proposal
Having both behaviors is confusing, all of these should have the same result.
Furthermore, it seems like echo '[[0,123],[1,456]]' | jp -xy '[*]', or echo '[[0,123],[1,456]]' | jp -xy '$', or even echo '[[0,123],[1,456]]' | jp should produce a valid plot:
Background
Currently, our version of JSONPath has two index-selection behaviors:
Union-selection
[[1,2],["a","b"]]
[*][0,1]
[1,"a",2,"b"]]
The results are concatenated: first all 0-components, then all 1-components. This is the default behavior for field selection
.[myField1, myField2]
and was also chosen for index-selection for consistency.All-selection
[[1,2],["a","b"]]
[*][*]
[1,2,"a","b"]
The results are interleaved: 0,1,0,1. This is the default JSONPath index selection behavior.
Proposal
Having both behaviors is confusing, all of these should have the same result.
Furthermore, it seems like
echo '[[0,123],[1,456]]' | jp -xy '[*]'
, orecho '[[0,123],[1,456]]' | jp -xy '$'
, or evenecho '[[0,123],[1,456]]' | jp
should produce a valid plot:Currently, only
jp -xy '[*][0,1]'
produces this.I would propose that
[*][*] = [*][0,1] = 0.0, 0.1, 1.0, 1.1
)-xy
JSONpath.[[x,y],[x,y],...]
input.Proposal
3.
in particular is quite debatable, so I'd appreciate any feedback on this.