Open HolQue opened 1 month ago
Similar scenario:
"dictParam" : {"A" : 1, "B" : 2},
"param" : ${dictParam.3}
A key error is detected properly:
Error: 'Could not resolve expression '${dictParam}[3]'. Reason: Key error 3'!
The same with leading zero in key name:
"dictParam" : {"A" : 1, "B" : 2},
"param" : ${dictParam.03}
Result:
Error: 'The parameter '${dictParam}[03]' is not available!'!
For sure, that is not wrong, but I would prefer a 'key error'.
Implicit creation of a nested dictionary:
${params.001.param} : 2
Result:
Error: 'Could not set parameter '${params.001.param}' with value '2'! Reason: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers (<string>, line 1)'!
How to handle this?
In this combination it works properly:
Also this works properly:
${params}['001']['param'] : 1
Also no problems with:
${params.1.param} : 1
and with:
${params.a001.param} : 2
In Python 3, dictionary keys can also be of type
int
. But as per my understanding, JSON does not support numeric keys. Every key is of typestr
. How does the JsonPreprocessor handle expressions like:${params.1.param} : 1
Is the key
1
of typeint
or of typestr
? Ifstr
, leading zeros should not harm the computation. And I have currently no idea why the JsonPreprocessor should make1
an integer.