Skip to content

delimiter expected #221

@HolQue

Description

@HolQue

JSON code

"listparam" : ["A","B","C"],
"param" : ${listparam}0]

results in

'Invalid nested parameter format: ${listparam}0 - The double quotes are missing!!!'

The closing curly bracket is also part of the invalid expression, but missing in the error message.

Nevertheless the error message is correct. This expression is invalid because an opened square bracket is missing. If the entire expression would be encapsulated in quotes, it can be interpreted as composite string, containing two parts, part 1: "${listparam}", part 2: "0]"

Therefore with quotes:

"listparam" : ["A","B","C"],
"param" : "${listparam}0]"

But the outcome now is:

'JSON file: ....json
Expecting ',' delimiter: line 3 column 35 (char 68)'

Why is that? There is no delimiter missing.

Possibly the double quotes are the problem. When ${listparam} is substituted, maybe the result is

"param" : "["A","B","C"]0]"

And for sure, this would make trouble to the JSON interpreter. A solution could be to replace the double quotes by single quotes:

Resolved: "param" : "['A','B','C']0]"

This should not cause problems. But does it make sense?

I suggest to rethink the design.

Do we really need dollar operator substitutions based on other data types than simple strings and integers? I am not convinced.

On the left hand side of the colon we already suppress this. We should suppress this on the right hand side of the colon also.

Metadata

Metadata

Assignees

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions