File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -945,7 +945,7 @@ func isDotPiperChar(s string) bool {
945945 // check that the next component is *not* a modifier.
946946 i := 1
947947 for ; i < len (s ); i ++ {
948- if s [i ] == '.' || s [i ] == '|' {
948+ if s [i ] == '.' || s [i ] == '|' || s [ i ] == ':' {
949949 break
950950 }
951951 }
Original file line number Diff line number Diff line change @@ -2554,3 +2554,22 @@ func TestIndexAtSymbol(t *testing.T) {
25542554 }`
25552555 assert (t , Get (json , "@context.@vocab" ).Index == 85 )
25562556}
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