-
Notifications
You must be signed in to change notification settings - Fork 2
Description
JSON code:
{
"param1" : "prefix",
"param2" : [1,2,3],
"param3" : {"${param1}_${param2}_suffix" : "value"}
}
The expression "${param1}_${param2}_suffix" is the name of a dictionary key. And this dictionary is the value of "param3".
Because of param2 is a parameter of type list, a substitution of ${param2} within this key name is not allowed.
The JsonPreprocessor returns the following exception:
'Key name or value is a mix of nested parameters and hard coded parts.
The entire expression {"${param1}_${param2}_suffix" must be enclosed in quotes'
This error message is misleading and makes no sense. The problem here is not a missing quote. It seems that the opened curly bracket in {"${param1}_${param2}_suffix" is interpreted as part of a value. But it's a JSON syntax element that indicates the beginning of a dictionary definition instead.
Expected is an error message telling that it's not allowed to replace parameters of composite data types within key names.
Reference:
and latest JsonPreprocessor test branch.
Metadata
Metadata
Labels
Projects
Status