test-fullautomation / python-jsonpreprocessor

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

Composite string not detected #102

Closed HolQue closed 9 months ago

HolQue commented 11 months ago

This is the content of JSON file:

"par1"   : "par1",
"par2"   : "par2",
"par3"   : ["A", "B"],
"par4"   : ["ara"],
"ara"    : "ara",
"param"  : "param",
"param2" : ${par3},
//
"val2" : ${par3}[0]${p${par4}[0]m2}[1]

val2 consists of a composite string. The first part is represented by ${par3}[0], the second part is represented by ${p${par4}[0]m2}[1].

Because of the string is a composite one, it is expected that the entire expression in encapsulated in quotes. The quotes are missing, therefore I expect an error message, telling about these missing quotes. But I do not expect returned values.

Instead of this the JsonPreprocessor returns values. The value of val2 is: 'ara'.

When I add the missing quotes:

"val2" : "${par3}[0]${p${par4}[0]m2}[1]"

the JsonPreprocessor also returns values, but now this is expected. But the value of val2 now is: 'A'.

Both returned values are wrong. In second case (with quotes around expression) the expected value for val2 is 'AB'.

namsonx commented 10 months ago

Hello Holger, Hello Thomas,

This issue was fixed in stabi branch (namsonx/task/stabi_branch)

Thank you, Son

HolQue commented 9 months ago

Retest successful

test-fullautomation commented 9 months ago

solved and already merged with #147