Comparison of the different implementations of JSONPath and language agnostic test suite.
Comparison of the different implementations of JSONPath and language agnostic test suite.
See https://cburgmer.github.io/json-path-comparison/ for the table generated from the queries in ./queries.
If you are an author of an upstream implementation, you can use the report generated here to test for regressions in your logic. The regression_suite/regression_suite.yaml holds all queries and includes a consensus where one exists. Additionally a report is generated for every implementation which contains current results for queries where the consensus isn't matched or no consensus exists (see e.g. regression_suite/Clojure_json-path.yaml).
See for example the Clojure json-path regression test on how those files can be put to use.
To update the reports checked into Git under ./docs and others, run:
./src/with_native.sh ninja
open docs/index.html
Alternatively, you can use Docker to provide the dependencies via
./src/with_docker.sh ninja
This will take a while and some network bandwidth but has the benefit that you won't have to install anything locally.
You can quickly execute a query against all implementations by running:
echo '{"a": 1}' | ./src/with_native.sh ./src/one_off.sh '$.a'
(Or use ./src/with_docker.sh if you prefer Docker.)
Some of the complexity sadly brings its own set of errors
FAILED
to identify the failing
step. The error is most likely captured in the output file (the part behind
the >
). Debug from there.rm -r build/results/bracket_notation_with_number_on_short_array
for a whole
query, and re-running Ninja to force a re-build.docker rmi json-path-comparison
and start from
scratch../src/with_docker.sh
:
Write to ./src/docker_env_file.txt
in accordance with the --env-file
option specified in the docker run
command../src/with_native.sh
:
Directly export environment variables.