jsonpath icon indicating copy to clipboard operation
jsonpath copied to clipboard

Results do not match other implementations

Open cburgmer opened this issue 6 years ago • 0 comments

The following queries provide results that do not match those of other implementations of JSONPath (compare https://cburgmer.github.io/json-path-comparison/):

  • [ ] $[1:10] Input:

    ["first", "second", "third"]
    

    Expected output:

    ["second", "third"]
    

    Error:

    index [to] out of range: len: 3, to: 10
    
  • [ ] $[:2] Input:

    ["first", "second", "third", "forth", "fifth"]
    

    Expected output:

    ["first", "second"]
    

    Actual output:

    ["first", "second", "third"]
    
  • [ ] $[1:3] Input:

    ["first", "second", "third", "forth", "fifth"]
    

    Expected output:

    ["second", "third"]
    

    Actual output:

    ["second", "third", "forth"]
    
  • [ ] $[0:1] Input:

    ["first", "second"]
    

    Expected output:

    ["first"]
    

    Actual output:

    ["first", "second"]
    

For reference, the output was generated by the program in https://github.com/cburgmer/json-path-comparison/tree/master/implementations/Golang_github.com-oliveagle-jsonpath.

cburgmer avatar Sep 12 '19 20:09 cburgmer