test-fullautomation / python-jsonpreprocessor

A preprocessor for json files
Apache License 2.0
2 stars 2 forks source link

List element of wrong type #287

Open HolQue opened 1 month ago

HolQue commented 1 month ago

I have an index. I use this index to get a value from a list. This value is an integer. I use this value as index to get a value from a list:

"index"     : 1,
"indexList" : [0,1,2],
"param1"    : ${indexList}[${indexList}[${index}]]

Result:

{'index': 1, 'indexList': [0, 1, 2], 'param1': '1'}

param1 is of data type str. Why this? There is no string conversion involved in the JSON code above.

Expected is integer value 1.

Several combinations of this JSON code can be found in

https://github.com/test-fullautomation/python-jsonpreprocessor/blob/develop/test/testfiles/jpp-test_config_1500.jsonp

and

https://github.com/test-fullautomation/python-jsonpreprocessor/blob/develop/test/testfiles/jpp-test_config_1501.jsonp

Corresponding lines are commented out. Affected parameters: param03, param11, k20C, k21B