summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 {
}
+
+