From 7bc7c04cbd930358ab498a319c60f40bd9f9a2a0 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Tue, 10 Apr 2018 16:29:48 +0530 Subject: Ignore param validation for is_include=false Issue-ID: CLI-100 Change-Id: Ie11a2b409ab71b1c74299e2de4433decc08f6289 Signed-off-by: Kanagaraj Manickam k00365106 --- .../src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 { } + + -- cgit 1.2.3-korg