Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package jsonpath
import (
"context"
"fmt"
"strconv"

"github.com/PaesslerAG/gval"
"reflect"
"strconv"
)

//plainSelector evaluate exactly one result
Expand Down Expand Up @@ -116,10 +116,19 @@ func visitAll(v interface{}, visit func(key string, v interface{})) {
for k, e := range v {
visit(k, e)
}
case interface{}:
vo := reflect.ValueOf(v)
if vo.Kind() == reflect.Map {
for _, vok := range vo.MapKeys() {
if vok.Kind() == reflect.String || vok.Kind() == reflect.Int {
visit(vok.String(), vo.MapIndex(vok).Interface())
}
}
}
}

}


//[? ]
func filterSelector(filter gval.Evaluable) ambiguousSelector {
return func(c context.Context, r, v interface{}, match ambiguousMatcher) {
Expand Down