test-fullautomation / python-jsonpreprocessor

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

Nested lists not resolved #253

Closed HolQue closed 4 weeks ago

HolQue commented 1 month ago

The following code defines a list in two ways (param1 and param2): with a single index value and with an index applied to a list.

"listParam"   : [0,1,2],
"index"       : 1,
"param1"      : [${index}, "B"],
"param2"      : [${listParam}[${index}], "B"]

The outcome in both ways is a list [1, "B"]. This is like expected.

Now I put the param2 expression into another list:

"param3" : [[${listParam}[${index}], "B"], "C"]

Outcome is an error:

Expecting ':' delimiter: line ...

Now I move the dollar operator expression inside the innermost list from first position to last position:

"param4" : [["B" , ${listParam}[${index}]], "C"]

Outcome is an error (now another delimiter is missing):

Expecting ',' delimiter: line ...

I cannot see that a delimiter is missing and would expect that param3 and param4 contain the defined lists.

Addendum

I define a nested list with every element is ${listParam}[${index}]

"param5" : [${listParam}[${index}], [${listParam}[${index}], ${listParam}[${index}]], ${listParam}[${index}]]

Outcome is an error:

Error: 'Invalid expression while handling the parameter '[${listParam}[${index}]'.'!

HolQue commented 1 month ago

Covered by JPP_1400

namsonx commented 1 month ago

Hello Holger,

This issue is fixed on stabi branch, the test case JPP_1400 is also enabled.

Thank you, Son

HolQue commented 1 month ago

Retest successful. Issue can be closed.

test-fullautomation commented 4 weeks ago

integrated in RobotFramework AIO 0.11.0