SMJJSONPath icon indicating copy to clipboard operation
SMJJSONPath copied to clipboard

Towards a shared understanding of JSONPath

Open cburgmer opened this issue 5 years ago • 5 comments

I'm collecting JSONPath implementations to show diverging implementations and help libraries to converge towards a similar interpretation of the original JSONPath post. You can see the current state of the comparison here: https://cburgmer.github.io/json-path-comparison/

I'm still looking into making SMJJSONPath compile in an Alpine Docker container, so currently this implementation is still missing from the table. (The work in progress is here: https://github.com/cburgmer/json-path-comparison/tree/Objective-C_SMJJSONPath/implementations/Objective-C_SMJJSONPath)

While I'm happy for help on getting this to run on Linux, for now I just wanted to share this with you here as this might already provide you with more test cases to align your implementation with.

cburgmer avatar Jan 23 '20 20:01 cburgmer

Hi @cburgmer. Wow, incredible job, thank you for that !

As documented, my implementation (almost) follows the one done in Java by Jayway JsonPath, so I expect the result to be not that far (and it seems somehow good, from what I see in your comparison page).

Also, I reimplemented (most of) their Unit-Test, but indeed, more test case is always better to prove robustness !

For the Linux thing, I never did that before. I heard it was somehow possible to run Objective-C on it, but I didn't even know it was that much possible. But if you have some specifics question, I can try to help… ;)

javerous avatar Jan 23 '20 22:01 javerous

I'm trying this from 2 angles:

  1. Find a consensus to distill a standard
  2. Build a regression test suite for everybody to align against.

Part 2 already works for you, you could pull the regression test YAML file and test against that if you want.

cburgmer avatar Jan 24 '20 10:01 cburgmer

I will take a look. It's https://github.com/cburgmer/json-path-comparison/blob/Objective-C_SMJJSONPath/regression_suite/regression_suite.yaml right ?

javerous avatar Jan 24 '20 12:01 javerous

Yes, but you want to pick the one from master: https://github.com/cburgmer/json-path-comparison/blob/master/regression_suite/regression_suite.yaml

Once SMJJSONPath is added, it might influence the consensus and hence change the regression suite, but I'd say the consensus is more conservative than need be. I'll expect you'll agree with most - if not all outcomes in the regression suite.

cburgmer avatar Jan 24 '20 16:01 cburgmer

See #6 now for the outcome of the comparison against this library. You'll also find it listed in https://cburgmer.github.io/json-path-comparison/.

cburgmer avatar May 02 '20 20:05 cburgmer