jsonGet() expression function doesn't work with leading numbers in path segments

jsonGet() expression function doesn't work with leading numbers in path segments.
In this demonstration expression below, neither "item.0" or "item.0L" work. "item.L0" does.

jsonGet("{'item':{'first':1, 'second':2, '0':3, '0L':4, 'L0':5}}", "item.L0")

Equivalent addressing via scripting works fine though:

test = {'item':{'first':1, 'second':2, '0':3, '0L':4, 'L0':5}}
print test['item'][str(0)]
print test['item']['0']
print test['item']['0L']

Each of those works as expected.
Tested in 8.3.2 (b2025120210) for reference.

Because it isn't valid JSON. Those keys are valid for jython dictionaries, but not jython attributes.

Use item['0'] and item['0L'].

1 Like