I think a.[0].[0] and a.[1].[0] should not be part of the results and their value should not be as it is.
import jsonpath_ng
print('VERSION: ' + jsonpath_ng.__version__)
data = {'a': ['foo', 'bar']}
for datum in jsonpath_ng.parse('$..[*]').find(data):
print(f"\npath: {datum.full_path} | value: {datum.value}")
try:
equivalent_datum = jsonpath_ng.parse(str(datum.full_path)).find(data)[0]
if equivalent_datum.value != datum.value:
print(f"THE CORRECT VALUE IS: {equivalent_datum.value}")
except KeyError:
pass
VERSION: 1.5.3
path: [0] | value: {'a': ['foo', 'bar']}
path: a.[0] | value: foo
path: a.[1] | value: bar
path: a.[0].[0] | value: foo
THE CORRECT VALUE IS: f
path: a.[1].[0] | value: bar
THE CORRECT VALUE IS: b
I think
a.[0].[0]
anda.[1].[0]
should not be part of the results and their value should not be as it is.