aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/main/java/org/onap
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-04-10 16:29:48 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-04-23 10:50:19 +0530
commit7bc7c04cbd930358ab498a319c60f40bd9f9a2a0 (patch)
tree18784b823d2d33158754fd6f56c6a52b5e2473bb /framework/src/main/java/org/onap
parent49842ac0f22c9542c3b03995207347519f2d6951 (diff)
Ignore param validation for is_include=false
Issue-ID: CLI-100 Change-Id: Ie11a2b409ab71b1c74299e2de4433decc08f6289 Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'framework/src/main/java/org/onap')
-rw-r--r--framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java b/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java
index accea717..db89e067 100644
--- a/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java
+++ b/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java
@@ -17,6 +17,8 @@
package org.onap.cli.fw.utils;
import static org.onap.cli.fw.conf.OnapCommandConstants.BOOLEAN_VALUE;
+import static org.onap.cli.fw.conf.OnapCommandConstants.IS_INCLUDE;
+import static org.onap.cli.fw.conf.OnapCommandConstants.BOOLEAN_TRUE;
import java.util.ArrayList;
import java.util.Collections;
@@ -72,8 +74,9 @@ public class OnapCommandUtils {
for (String param : totalParams) {
boolean isMandatory = mandatoryParams.contains(param);
boolean isYamlContains = yamlMap.containsKey(param);
+ boolean isInclude = yamlMap.containsKey(IS_INCLUDE) && yamlMap.get(IS_INCLUDE).toString().equals(BOOLEAN_TRUE);
if (isMandatory) {
- if (!isYamlContains) {
+ if (!isYamlContains && isInclude) {
schemaErrors.add("Mandatory attribute '" + param + "' is missing under '" + section + "'");
} else {
String value = String.valueOf(yamlMap.get(param));
@@ -347,3 +350,5 @@ public class OnapCommandUtils {
}
+
+