Comments (7)
Goessner, when discussing dot notation and bracket notation, says that "...output paths will always be converted to the more general bracket–notation", which suggests the correct return value would be $['a']['b']
, not $.a.b
.
from json-path-comparison.
Maybe it's sufficient to just have a check to see if it's supported for a given library.
If the unit JSON has unique values, then testing on the values returned would be good enough to know that the query did what we expect.
From there, it's a reasonable assumption that the paths to the values would be correct.
from json-path-comparison.
While I understand the tendency to use JSON Path for the locations (seeing as that's what we're building, which is likely why Goessner suggested it), I don't think that it's appropriate for this use case. JSON Pointer is more appropriate here since it's designed to isolate and identify a single value from a document. JSON Path is a query syntax and returns an array of values.
JSON Pointer is an extremely simple syntax that's already in spec and has wide library support.
from json-path-comparison.
My remorhaz/php-json-path supports returning paths (with one of these methods of processor). But I don't think that checking this behaviour is of big value: the main problem is that different implementations select different values, not paths.
from json-path-comparison.
We could include it in the scope.
I would probably only invest if enough libraries support this operation and there's a tendency to agree on a similar response type.
I know of the Clojure implementation also supporting this, as I implemented it 3 years ago :)
from json-path-comparison.
But what we should check in this case? For example, implementation X returns $.a.b
, and implementation Y returns $["a"]["b"]
as a path string. The expressions are different, but they do the same work and return the same value.
The question is - is there any reason for the paths not to be different?
from json-path-comparison.
If we see that response formats are different, we might be able to write a trivial transformation.
As for why answers should be different, I would expect less deviation once the actual JSONPath responses are aligned. However I wouldn't rule out misalignment there either, I'm always surprised what I find once I dare to check.
from json-path-comparison.
Related Issues (20)
- Is it possible to provide JSONPath test cases based on consensus results HOT 7
- Show footnote 4 if applicable on the query detail page
- Need test for filter expression checking for local key in array with a null value
- Alignment with spec in its current state (a report) HOT 7
- Incorporating and merging with the compliance test suite HOT 3
- Add nimma
- Include github.com/SteelBridgeLabs/jsonpath HOT 1
- Failing build of Java implementations in the docker container HOT 1
- Add serde_json_path HOT 2
- Add jpt HOT 2
- Bump JsonPath.Net to v1.0.0 HOT 3
- Comparing dotNET_JsonPathLib questionable
- Project governance HOT 7
- Link to reference implementation
- Support for path axis navigation HOT 11
- Issue with display of queries containing the * character HOT 1
- Expand on type of consensus HOT 2
- Tests for root reference in filter expressions. HOT 3
- Analysis HOT 2
- provide key for table contents HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-path-comparison.