akshaymankar / jsonpath-hs

Haskell implementation of JSONPath
BSD 3-Clause "New" or "Revised" License
6 stars 5 forks source link

Results do not match other implementations #6

Closed cburgmer closed 2 years ago

cburgmer commented 4 years ago

Results do not match other implementations

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

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

schrammc-ebot7 commented 2 years ago

A good amount of these is resolved. It might make sense to remove them from the list (or at least mark them as done) in order to better keep track in the future.

cburgmer commented 2 years ago

The issue was automatically collated. The latest version is here: https://github.com/cburgmer/json-path-comparison/blob/master/bug_reports/Haskell_jsonpath.md

Feel free to replace the bug report with the updated list, thus deleting the old entries.

akshaymankar commented 2 years ago

I ran the report locally by pinning jsonpath to the HEAD of this repo. I have updated the list. I will make a release and update the build in the json-path-comparison repo.

schrammc commented 2 years ago

Are we sure this list of cases is correct? There is a unit test for $[""] working but the list here says the path doesn't parse.

Specifically if I run this through GHCI on latest master I get

λ> let Right x = parseOnly jsonPath "$['']"
λ> resultToEither $ executeJSONPath x (fromJust $ decode "{\"\": 42}")
Right [Number 42.0]
akshaymankar commented 2 years ago

Hmm, looks like ninja is not running some rules again. Let me see if I can convince it to run things.

akshaymankar commented 2 years ago

Alright, I have fixed the top comment.

akshaymankar commented 2 years ago

With #32 all the old problems got solved and a new one came up. I think its ok if this implementation supports filters without brackets, so I will just leave it and close this issue.

glyn commented 1 year ago

I think its ok if this implementation supports filters without brackets, so I will just leave it and close this issue.

Onlookers please note the draft IETF spec supports filters without brackets.