Skip to content

Results do not match other implementations #6

@cburgmer

Description

@cburgmer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions