Skip to content

Commit

Permalink
Merge pull request #305 from test-fullautomation/namsonx/task/stabi_b…
Browse files Browse the repository at this point in the history
…ranch

Namsonx/task/stabi branch
  • Loading branch information
test-fullautomation authored May 15, 2024
2 parents 2d85a5c + ee029c4 commit 8a36ad5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions JsonPreprocessor/CJsonPreprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,8 @@ def __handleDotInNestedParam(sNestedParam : str) -> str:
dataType = re.sub(r"^.+'([a-zA-Z]+)'.*$", "\\1", str(type(tmpValue)))
self.__reset()
raise Exception(f"The substitution of parameter '{sVar.replace('$$', '$')}' inside the string \
value '{sInputStr.replace('$$', '$')}' is not supported! The composite data types between 'str' \
and '{dataType}' is not acceptable.")
value '{sInputStr.replace('$$', '$')}' is not supported! Composite data types like lists and dictionaries cannot \
be substituted inside strings.")
while var[0] in sInputStr:
sLoopCheck1 = sInputStr
dReplacements = {"$" : "\$", "[" : "\[", "]" : "\]"}
Expand Down Expand Up @@ -638,13 +638,12 @@ def __handleDotInNestedParam(sNestedParam : str) -> str:
raise Exception(errorMsg)
else:
tmpValue = __getNestedValue(sVar)
if len(sInputStr.strip())>len(sVar.strip()) and bConvertToStr and \
(isinstance(tmpValue, list) or isinstance(tmpValue, dict)):
if bConvertToStr and (isinstance(tmpValue, list) or isinstance(tmpValue, dict)):
dataType = re.sub(r"^.+'([a-zA-Z]+)'.*$", "\\1", str(type(tmpValue)))
self.__reset()
raise Exception(f"The substitution of parameter '{sVar.replace('$$', '$')}' inside the string \
value '{sInputStr.replace('$$', '$')}' is not supported! The composite data types between 'str' \
and '{dataType}' is not acceptable.")
value '{sInputStr.replace('$$', '$')}' is not supported! Composite data types like lists and dictionaries cannot \
be substituted inside strings.")
if re.match(r"^\s*" + tmpPattern + r"\s*$", sInputStr, re.UNICODE) and not bKey:
return tmpValue
else:
Expand Down

0 comments on commit 8a36ad5

Please sign in to comment.