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
8 tasks
cburgmer opened this issue Dec 6, 2019 · 1 comment
Open
8 tasks

Results do not match other implementations #6

cburgmer opened this issue Dec 6, 2019 · 1 comment

Comments

@cburgmer
Copy link

cburgmer commented Dec 6, 2019

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

  • $.2
    Input:

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

    Expected output:

    ["second"]
    

    Error:

    init terminating in do_boot ({badmatch,{error,{1,ejsonpath_parse,syntax error before: 2}}})
    
    Crash dump is being written to: erl_crash.dump...done
    {"init terminating in do_boot",{badmatch,{error,{1,ejsonpath_parse,["syntax error before: ",["2"]]}}}}
    
  • $[-1:]
    Input:

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

    Expected output:

    ["third"]
    

    Error:

    init terminating in do_boot ({badmatch,{error,{1,ejsonpath_parse,syntax error before: ':'}}})
    
    Crash dump is being written to: erl_crash.dump...done
    {"init terminating in do_boot",{badmatch,{error,{1,ejsonpath_parse,["syntax error before: ","':'"]}}}}
    
  • $[:]
    Input:

    ["first", "second"]
    

    Expected output:

    ["first", "second"]
    

    Error:

    init terminating in do_boot ({badmatch,{error,{1,ejsonpath_parse,syntax error before: ']'}}})
    
    Crash dump is being written to: erl_crash.dump...done
    {"init terminating in do_boot",{badmatch,{error,{1,ejsonpath_parse,["syntax error before: ","']'"]}}}}
    
  • $[1:3]
    Input:

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

    Expected output:

    ["second", "third"]
    

    Actual output:

    ["second", "third", "forth", "fifth"]
    
  • $[0:3:2]
    Input:

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

    Expected output:

    ["first", "third"]
    

    Error:

    init terminating in do_boot ({not_implemented,slice})
    
    Crash dump is being written to: erl_crash.dump...done
    {"init terminating in do_boot",{not_implemented,slice}}
    
  • $[::2]
    Input:

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

    Expected output:

    ["first", "third", "fifth"]
    

    Error:

    init terminating in do_boot ({badmatch,{error,{1,ejsonpath_parse,syntax error before: ':'}}})
    
    Crash dump is being written to: erl_crash.dump...done
    {"init terminating in do_boot",{badmatch,{error,{1,ejsonpath_parse,["syntax error before: ","':'"]}}}}
    
  • $..key
    Input:

    {"object": {"key": "value", "array": [{"key": "something"}, {"key": {"key": "russian dolls"}}]}, "key": "top"}
    

    Expected output:

    ["russian dolls", "something", "top", "value", {"key": "russian dolls"}]
    

    Error:

    init terminating in do_boot (function_clause)
    
    Crash dump is being written to: erl_crash.dump...done
    {"init terminating in do_boot",function_clause}
    
  • $
    Input:

    {"key": "value", "another key": {"complex": ["a", 1]}}
    

    Expected output:

    [{"another key": {"complex": ["a", 1]}, "key": "value"}]
    

    Error:

    init terminating in do_boot ({badmatch,{error,{1,ejsonpath_parse,syntax error before: }}})
    
    Crash dump is being written to: erl_crash.dump...done
    {"init terminating in do_boot",{badmatch,{error,{1,ejsonpath_parse,["syntax error before: ",[]]}}}}
    

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

@seriyps
Copy link
Contributor

seriyps commented Dec 6, 2019

Yep, most of them are known issues. But now project is not actively maintained.
If someone will create a PR I will be able to review, but unlikely will fix myself

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