test-fullautomation / python-jsonpreprocessor

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

Dollar operator substitution for key names fails (2) #93

Closed HolQue closed 11 months ago

HolQue commented 1 year ago

Similar to https://github.com/test-fullautomation/python-jsonpreprocessor/issues/91

JSON file:

"string_01" : "ABC",
"string_02" : "DEF",
${string_01}_composite_param_name_${string_02} : "(1.01)--'${string_01}'--(1.02)--'${string_02}'"

The third parameter name is a composite string. Because of that it is expected that the entire expression is encapsulated in quotes:

"${string_01}_composite_param_name_${string_02}"

Because of the quotes are missing I expect a syntax error, but the JsonPreprocessor generates this name:

string_01_composite_param_name_DEF

with the first parameter not resolved properly.

test-fullautomation commented 1 year ago

Hi @namsonx , what is the status of this ticket? Thank you, Thomas

test-fullautomation commented 11 months ago

Son implements and waits for retest from Holger.

namsonx commented 11 months ago

Hello Holger, Hello Thomas,

For the jsonp file with content:

"string_01" : "ABC",
"string_02" : "DEF",
${string_01}_composite_param_name_${string_02} : "(1.01)--'${string_01}'--(1.02)--'${string_02}'"

The JsonPreprocessor will issue the error message:

Exception: Invalid nested parameter format: ${string_01}_composite_param_name_${string_02} - The double quotes are missing!!!

If we put this key name into the double quotes, the output will show as below:

string_01 : ABC
string_02 : DEF
ABC_composite_param_name_DEF : (1.01)--'ABC'--(1.02)--'DEF'

I had implemented it long time ago but forgot updating this ticket.

Could you please help me check?

Thank you, Son

HolQue commented 11 months ago

Retest successful. Issue can be closed.