test-fullautomation / python-jsonpreprocessor

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

Expression with not existing parameter not resolved #252

Closed HolQue closed 4 weeks ago

HolQue commented 1 month ago

In following three code examples the not existing parameter is detected properly:

"listP"  : ["A", "B"],
"params" : ${listP}[${IAMNOTEXISTING}]
"listP"  : ["A", "B"],
"params" : [${listP}[${IAMNOTEXISTING}], "ABC"]
"listP"  : ["A", "B"],
"params" : {"ABC" : [${listP}[${IAMNOTEXISTING}], "DEF"]}

Result:

Error: 'The variable '${IAMNOTEXISTING}' is not available!'!

But after adding another level of nested brackets:

"listP"  : ["A", "B"],
"params" : [{"ABC" : [${listP}[${IAMNOTEXISTING}], "DEF"]}, "GHI"]

the result is:

{'listP': ['A', 'B'],
 'params': [{'ABC': ['${listP}[${IAMNOTEXISTING}]', 'DEF']}, 'GHI']}

It is not detected any more that a parameter does not exist, and the entire dollar operator expression ${listP}[${IAMNOTEXISTING}] is inserted as string into the list.

But expected is the same error message than above.

namsonx commented 1 month ago

Hello Holger,

This issue is fixed on statbi branch.

Thank you, Son

HolQue commented 1 month ago

Hi Son,

huge improvement!

Thank you.

Retest successful. Issue can be closed.

test-fullautomation commented 4 weeks ago

integrated in RobotFramework AIO 0.11.0