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 #6

Open
6 tasks
cburgmer opened this issue May 2, 2020 · 2 comments
Open
6 tasks

Results do not match other implementations #6

cburgmer opened this issue May 2, 2020 · 2 comments

Comments

@cburgmer
Copy link
Contributor

cburgmer commented May 2, 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:

    []
    

    Error:

    Filter: [1:3] can only be applied to arrays. Current context is: {
        ":" = 42;
        a = 1;
        b = 2;
        c = 3;
        more = string;
    }
    
  • $[:]
    Input:

    ["first", "second"]
    

    Expected output:

    ["first", "second"]
    

    Error:

    Failed to parse SliceOperation: :
    
  • $[::]
    Input:

    ["first", "second"]
    

    Expected output:

    ["first", "second"]
    

    Error:

    Failed to parse SliceOperation: ::
    
  • $[0:3:2]
    Input:

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

    Expected output:

    ["first", "third"]
    

    Actual output:

    ["first", "second", "third"]
    
  • $[',']
    Input:

    {",": "value", "another": "entry"}
    

    Expected output:

    "value"
    

    Error:

    Found empty property at index 5
    
  • $[0]['c','d']
    Input:

    [{"c": "cc1", "d": "dd1", "e": "ee1"}, {"c": "cc2", "d": "dd2", "e": "ee2"}]
    

    Expected output:

    ["cc1", "dd1"]
    

    Actual output:

    {"c": "cc1", "d": "dd1"}
    

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

@cburgmer
Copy link
Contributor Author

cburgmer commented May 2, 2020

I can see perfect alignment with the Java implementation :)
Do feel free to decide whether to follow up on those results or not. This issue for now is just meant to create visibility!

@javerous
Copy link
Owner

javerous commented May 2, 2020

@cburgmer Thank you very much for this incredible work, very helpful !

So well, yes, my choice was to follow this specific Java implementation because I didn't have enough time to take my own road, and it's still the case, so I don't want to divert, and so I will stay on this choice. If they fix those problems, I will integrate the fixes in my Objective-C version ;)

KittyMac added a commit to KittyMac/Sextant that referenced this issue Dec 12, 2021
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

2 participants