From b8dfe72b7d7d3b90be00ee1e76f6a3de9e8a71e3 Mon Sep 17 00:00:00 2001 From: mas2hc Date: Mon, 12 Aug 2024 15:27:45 +0700 Subject: [PATCH] Enhancement 206 - Update error message of key names validation method. --- JsonPreprocessor/CJsonPreprocessor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/JsonPreprocessor/CJsonPreprocessor.py b/JsonPreprocessor/CJsonPreprocessor.py index 2483d58f..322a2894 100644 --- a/JsonPreprocessor/CJsonPreprocessor.py +++ b/JsonPreprocessor/CJsonPreprocessor.py @@ -1337,7 +1337,8 @@ def __keyNameValidation(self, sInput): if re.match(r'^[\s"]*[\+\-\*:@]+.*$', sInput): errorMsg = f"Invalid key name: {sInput}. Key names have to start with a character or digit." elif checkPattern.search(sInput): - errorMsg = f"Invalid key name: {sInput}. Key names must not contain these special characters \"!#$%^&()=[]{{}}|;',?`~\"" + errorMsg = f"Invalid key name: {sInput}. Key names must not contain these special characters \"!#$%^&()=[]{{}}|;',?`~\" \ +and have to start with a character or digit." elif re.search(r'\${[^}]*}', sInput): if re.search(r'\[\s*\]', sInput): errorMsg = f"Invalid key name: {sInput}. A pair of square brackets is empty!!!" @@ -1356,7 +1357,8 @@ def __keyNameValidation(self, sInput): errorMsg = f"Invalid syntax: Found index or sub-element inside curly brackets in the parameter '{sInput}'" break elif checkPattern.search(param[1]): - errorMsg = f"Invalid key name: '{param[1]}' in {sInput}. Key names must not contain these special characters \"!#$%^&()=[]{{}}|;',?`~\"" + errorMsg = f"Invalid key name: '{param[1]}' in {sInput}. Key names must not contain these special characters \"!#$%^&()=[]{{}}|;',?`~\" \ +and have to start with a character or digit." break else: nestedParam = param[0]