test-fullautomation / python-jsonpreprocessor

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

Possible error message improvement #100

Closed HolQue closed 3 months ago

HolQue commented 11 months ago

In this expression a parameter does not exist:

"param" : "VAR-${variant_${list_variant_numbers}[${IAMNOTEXISTING}]}_MS-${milestone_${list_milestone_numbers}[${list_milestone_index}]} value"

JsonPreprocessor throws this exception:

'The variable '${list_variant_numbers}[${IAMNOTEXISTING}]' is not available!'

This is not really helpful. What exactly is not available? Is the index parameter not available? Is the index itself not available in the list? Is the list parameter not available?

If nested parameters are resolved recursively from innermost to outermost expression, I would expect, that the parser already stops at innermost expression, where ${IAMNOTEXISTING} is not existing.

The expected error message in this case is:

'The variable '${IAMNOTEXISTING}' is not available!'

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 8 months ago

Hello Holger, Hello Thomas,

I implemented this enhancement and pushed new commit 3ff0c76081 to stabi branch.

The test cases JPP_0256 and JPP_0258 can be active for JsonPreprocessor Selftest now.

Thank you, Son

HolQue commented 5 months ago

Retest successful. Issue can be closed.

namsonx commented 5 months ago

merged to develop branch