Skip to content

Commit

Permalink
Return correct result when filter returns array
Browse files Browse the repository at this point in the history
Fix: #215

Signed-off-by: Maxim Sukharev <[email protected]>
  • Loading branch information
smacker committed Jun 7, 2019
1 parent 9ac15b7 commit becc671
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 becc671

Please sign in to comment.