Array indexes with last return reverse order
lsytj0413 opened this issue · 4 comments
lsytj0413 commented
Give this code:
expr, err := jp.ParseString("$.vals[-3:]")
if err != nil {
panic(err)
}
result := expr.Get(map[string]interface{}{
"vals": []int{0, 10, 20, 30, 40, 50},
})
fmt.Printf("result: %v\n", result)
the result is: [50 40 30]
,but it should be [30 40 50]
,evaluated at https://jsonpath.com/
version: v1.17.5
ohler55 commented
I'll get it fixed.
ohler55 commented
Did release v1.18.0 and later fix the issue?
ohler55 commented
No response, closing.
lsytj0413 commented
Did release v1.18.0 and later fix the issue?
Sorry for the late reply. I have test it on v1.18.5,this have been fixed.