test-fullautomation / python-jsonpreprocessor

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

Index applied to a string does not work in dot notation #268

Closed HolQue closed 4 weeks ago

HolQue commented 1 month ago

In https://github.com/test-fullautomation/python-jsonpreprocessor/issues/104 I asked if it shall be supported by the JsonPreprocessor to apply an index to a string.

Test case https://github.com/test-fullautomation/python-jsonpreprocessor/blob/develop/test/testfiles/jpp-test_config_1500.jsonp gives evidence that this works fine. Therefore string indices should be handled as officially supported feature.

But this combination does not work:

"intParam" : 1,
"strParam" : "ABC",
"element"  : ${strParam.${intParam}}

Result:

Error: 'Invalid expression found: '${strParam.${intParam}}'.'!

For comparison, the same expression wrapped in quotes, work:

"element" : "${strParam.${intParam}}"

Result:

{'element': 'B', 'intParam': 1, 'strParam': 'ABC'}

(like expected)

The first code example should work also.

HolQue commented 1 month ago

Covered by JPP_1501

HolQue commented 1 month ago

Retest successful. Issue can be closed.

test-fullautomation commented 4 weeks ago

integrated in RobotFramework AIO 0.11.0