test-fullautomation / python-jsonpreprocessor

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

Error message (3) #233

Open HolQue opened 3 months ago

HolQue commented 3 months ago

In a previous version of the JsonPreprocessor, this code

"param1" : "prefix",
"param2" : [1,2,3],
"param3" : {"${param1}_${param2}_suffix" : "value"}

caused:

'Found expression '${param1}_${param2}_suffix' with at least one parameter of composite data type ('${param2}' is of type <class 'list'>). Because of this expression is the name of a parameter, only simple data types are allowed to be substituted inside.'

This is completely fine.

In current version this changed to:

'Found expression '${param2}' with at least one parameter of composite data type ('${param2}' is of type <class 'list'>). Because of this expression is the name of a parameter, only simple data types are allowed to be substituted inside.'

It is a great improvement that within the affected expression now a single parameter that causes the problem, can be detected. But in this case the part "with at least one parameter ..." of the error message can be removed.

Possible alternative:

Found parameter '${param2}' of composite data type ...

namsonx commented 3 weeks ago

Hello Holger,

Because we already blocked the substitution in key names, so the error message in this case now is: Exception: A substitution in key names is not allowed! Please update the key name "${param1}_${param2}_suffix"

Thank you, Son

HolQue commented 2 weeks ago

Retest successful. Issue can be closed.