You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ah, thanks @tienhung2812. The results look indeed... different.
jsonpath_ng.ext seems to improve things significantly. Most previously problematic queries seem to now converge towards a consensus, or the majority answer where no consensus exists, or at least stop failing. Only three queries seem to be "better" in the traditional implementation (have now started to fail or error out):
Mind you, currently those links show the traditional implementation. Two of those queries might indicate an invalid syntax.
If the community around jsonpath_ng prefers the jsonpath_ng.ext implementation, we could switch the comparison project over to that.
It would be generally possible to compare both implementations side by side in the comparison project, but that would at the same time negatively impact the consensus building, and allow this library two votes in the process, so I would not be in favour of that solution.
The following queries provide results that do not match those of other implementations of JSONPath
(compare https://cburgmer.github.io/json-path-comparison/):
$[::]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[:]
Input:
Expected output:
Actual output:
$[0:3:2]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[0:3:1]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[010:024:010]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[0:4:2]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[1:3:]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[::2]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$..[0]
Input:
Expected output (in any order as no consensus on ordering exists):
Error:
$[-2]
Input:
Expected output:
Error:
$.*[1]
Input:
Expected output:
Actual output:
$[0]
Input:
Expected output:
Error:
$[0]
Input:
Expected output:
Actual output:
$['*']
Input:
Expected output (in any order as no consensus on ordering exists):
Actual output:
$['*']
Input:
Expected output:
Actual output:
$..[*]
Input:
Expected output (in any order as no consensus on ordering exists):
Actual output:
$[*]
Input:
Expected output (in any order as no consensus on ordering exists):
Actual output:
$[key]
Input:
Expected output:
Actual output:
$.[key]
Input:
Expected output:
Actual output:
$..[1].key
Input:
Expected output (in any order as no consensus on ordering exists):
Error:
$[?(@.id==42)].name
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[0,2].key
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$.屬性
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$.2
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$.*.bar.*
Input:
Expected output:
Actual output:
$.*.*
Input:
Expected output:
Actual output:
$..*
Input:
Expected output (in any order as no consensus on ordering exists):
Actual output:
$..*
Input:
Expected output (in any order as no consensus on ordering exists):
Actual output:
$.*
Input:
Expected output:
Actual output:
$[?(@.key>42 && @.key<44)]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[?(@.key>43 || @.key<43)]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[?(@['key']==42)]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[?(@['@key']==42)]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[?(@[1]=='b')]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[?(@.key==43)]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[?(@.key=="Motörhead")]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[?(@.key=="[email protected]")]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[?(@.key=="some.value")]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[?(@.key=='value')]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$.items[?(@[email protected])]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[?(@.address.city=='Berlin')]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[0,1]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[0,0]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$.*['c','d']
Input:
Expected output:
Actual output:
$[4,1]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
$[ 0 , 1 ]
Input:
Expected output:
Actual output:
NOT_SUPPORTED
For reference, the output was generated by the program in https://github.com/cburgmer/json-path-comparison/tree/master/implementations/Python_jsonpath-ng.
Also do compare the draft version of the planned standard for JSONPath: https://ietf-wg-jsonpath.github.io/draft-ietf-jsonpath-base/draft-ietf-jsonpath-base.html
The text was updated successfully, but these errors were encountered: