test-fullautomation / python-jsonpreprocessor

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

Clarification wanted #114

Closed HolQue closed 9 months ago

HolQue commented 11 months ago

Several times in the past I wrote, that the expression on the right hand side of the colon

"param" : ${param1}${param2}

is a composite string and therefore must be encapsulated in quotes.

Now I am not sure any more. Most probably this statement is my mistake. Because there is no blank inside this expression. Therefore the entire expression should be identified as one single word. Are quotes required in this case?

Pure JSON would require quotes, but in our extended JSONP format quotes are not required in case of dollar operator expressions are involved. But quotes are possible - and cause a string conversion of the value.

How do we want to handle expressions containing not only one single dollar operators but several operators - without blanks inside?

Shall there be a syntactical difference between param3 and param4 in the following example? Shall both be possible? Or shall we keep the current implementation (in current implementation the param4 value is invalid because of the missing quotes)?

"param1" : 123,
"param2" : 4.56,
"param3" : "${param1}${param2}",
"param4" : ${param1}${param2}
HolQue commented 11 months ago

Related to

https://github.com/test-fullautomation/python-jsonpreprocessor/issues/102

HolQue commented 11 months ago

Outcome of discussion with Thomas:

"param3" : "${param1}${param2}",
"param4" : ${param1}${param2}

param3 is valid. param4 is invalid. Quotes are required in this case.

test-fullautomation commented 11 months ago

amendment: param4 is invalid because we keep the datatype and value if no double quotes are used. Concatenation makes in this case no sense. Therefore: No doubequote requires mandatorily only one $-expression which starts at the beginning. No other $-expression or data is allowed behind the $-expression except of comma.

test-fullautomation commented 9 months ago

@namsonx : What is the status of this issue?

test-fullautomation commented 9 months ago

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

namsonx commented 9 months ago

Hello Thomas,

In case, we decide param4 is invalid as the comment above, we have no thing to do in this case caused the ticket #102 were completed and verified. Currently, the output of for param4 is: Exception: Invalid nested parameter format: ${param1}${param2} - The double quotes are missing!!!

Thank you, Son

test-fullautomation commented 9 months ago

Hi Son, I hope "nested" is not part of the error message. There is no nesting here. Thank you, Thomas