File tree 2 files changed +20
-1
lines changed 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -945,7 +945,7 @@ func isDotPiperChar(s string) bool {
945
945
// check that the next component is *not* a modifier.
946
946
i := 1
947
947
for ; i < len (s ); i ++ {
948
- if s [i ] == '.' || s [i ] == '|' {
948
+ if s [i ] == '.' || s [i ] == '|' || s [ i ] == ':' {
949
949
break
950
950
}
951
951
}
Original file line number Diff line number Diff line change @@ -2554,3 +2554,22 @@ func TestIndexAtSymbol(t *testing.T) {
2554
2554
}`
2555
2555
assert (t , Get (json , "@context.@vocab" ).Index == 85 )
2556
2556
}
2557
+
2558
+ func TestDeepModifierWithOptions (t * testing.T ) {
2559
+ rawJson := `{"x":[{"y":[{"z":{"b":1, "c": 2, "a": 3}}]}]}`
2560
+ jsonPathExpr := `x.#.y.#.z.@pretty:{"sortKeys":true}`
2561
+ results := GetManyBytes ([]byte (rawJson ), jsonPathExpr )
2562
+ assert (t , len (results ) == 1 )
2563
+ actual := results [0 ].Raw
2564
+ expected := `[[{
2565
+ "a": 3,
2566
+ "b": 1,
2567
+ "c": 2
2568
+ }
2569
+ ]]`
2570
+ if expected != actual {
2571
+ t .Fatal (strconv .Quote (rawJson ) + "\n \t " +
2572
+ expected + "\n \t " +
2573
+ actual + "\n \t <<< MISMATCH >>>" )
2574
+ }
2575
+ }
You can’t perform that action at this time.
0 commit comments