Skip to content

Commit

Permalink
Merge pull request #216 from smacker/search_array
Browse files Browse the repository at this point in the history
Return correct result when filter returns array
  • Loading branch information
smacker authored Jun 11, 2019
2 parents 9ac15b7 + becc671 commit c7adde0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,15 @@ func (s *Server) handleParse(ctx *gin.Context) {
}
results := nodes.Array{}
for iter.Next() {
results = append(results, iter.Node().(nodes.Node))
n := iter.Node()
if nodes.KindOf(n) == nodes.KindArray {
for _, child := range n.(nodes.Array) {
results = append(results, child)
}
} else {
results = append(results, n.(nodes.Node))
}

}
resp = results
}
Expand Down

0 comments on commit c7adde0

Please # to comment.