Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Results do not match other implementations (Part 2) #123

Open
11 tasks
cburgmer opened this issue Mar 6, 2020 · 0 comments
Open
11 tasks

Results do not match other implementations (Part 2) #123

cburgmer opened this issue Mar 6, 2020 · 0 comments

Comments

@cburgmer
Copy link

cburgmer commented Mar 6, 2020

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

  • $[1:3]
    Input:

    {":": 42, "more": "string", "a": 1, "b": 2, "c": 3}
    

    Expected output:

    []
    

    Actual output:

    [null, null]
    
  • $[0:0]
    Input:

    ["first", "second"]
    

    Expected output:

    []
    

    Actual output:

    ["first"]
    
  • $[-4:]
    Input:

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

    Expected output:

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

    Actual output:

    ["third"]
    
  • $[*]
    Input:

    {}
    

    Expected output:

    []
    

    Error:

    divided by 0
    
  • $[*]
    Input:

    {"some": "string", "int": 42, "object": {"key": "value"}, "array": [0, 1]}
    

    Expected output:

    ["string", 42, [0, 1], {"key": "value"}]
    

    Actual output:

    [null, null, null, null]
    
  • $.2
    Input:

    {"a": "first", "2": "second", "b": "third"}
    

    Expected output:

    ["second"]
    

    Actual output:

    [null]
    
  • $.*.bar.*
    Input:

    [{"bar": [42]}]
    

    Expected output:

    [42]
    

    Actual output:

    [[42]]
    
  • $..*
    Input:

    [40, null, 42]
    

    Expected output:

    [40, null, 42]
    

    Actual output:

    [[40, null, 42], 40, null, 42]
    
  • $..*
    Input:

    42
    

    Expected output:

    []
    

    Actual output:

    [42]
    
  • $.*
    Input:

    []
    

    Expected output:

    []
    

    Actual output:

    [[]]
    
  • $.*
    Input:

    {}
    

    Expected output:

    []
    

    Actual output:

    [{}]
    

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

See #115 for a previous report. I have tried to avoid repeating previously mentioned queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant