From 8c79df8d4835e2cded87f60d78e5bf05e3cd6b16 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Mon, 25 Dec 2017 15:28:52 +0530 Subject: Merge default params files Issue-ID: CLI-66 Change-Id: I320e21ff3b25d0c38c196b49f2ed320174396e4a Signed-off-by: Kanagaraj Manickam k00365106 --- .../src/main/java/org/onap/cli/fw/http/cmd/OnapHttpCommand.java | 8 ++++++-- .../org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java | 3 ++- .../open-cli-schema/http/default_input_parameters_http.yaml | 5 ----- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'profiles/http/src/main') diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/cmd/OnapHttpCommand.java b/profiles/http/src/main/java/org/onap/cli/fw/http/cmd/OnapHttpCommand.java index 12309341..17d9c731 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/cmd/OnapHttpCommand.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/cmd/OnapHttpCommand.java @@ -61,6 +61,10 @@ public class OnapHttpCommand extends OnapCommand { private OnapCommandHttpService oclipService = new OnapCommandHttpService(); + public OnapHttpCommand() { + super.addDefaultSchemas(OnapCommandHttpConstants.DEFAULT_PARAMETER_HTTP_FILE_NAME); + } + public void setInput(HttpInput input) { this.input = input; } @@ -102,8 +106,8 @@ public class OnapHttpCommand extends OnapCommand { } @Override - protected List initializeProfileSchema(boolean validate) throws OnapCommandException { - return OnapCommandSchemaHttpLoader.loadHttpSchema(this, this.getSchemaName(), true, validate); + protected List initializeProfileSchema(Map schemaMap, boolean validate) throws OnapCommandException { + return OnapCommandSchemaHttpLoader.parseHttpSchema(this, schemaMap, validate); } @Override diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java b/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java index 08a70782..6dd15884 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java @@ -87,7 +87,7 @@ public class OnapCommandSchemaHttpLoader { * @throws OnapCommandException * on error */ - static ArrayList parseHttpSchema(OnapHttpCommand cmd, + public static ArrayList parseHttpSchema(OnapHttpCommand cmd, final Map values, boolean validate) throws OnapCommandException { ArrayList errorList = new ArrayList<>(); @@ -98,6 +98,7 @@ public class OnapCommandSchemaHttpLoader { if (validate) { OnapCommandUtils.validateTags(errorList, valMap, OnapCommandConfig.getCommaSeparatedList(OnapCommandHttpConstants.HTTP_SECTIONS), OnapCommandConfig.getCommaSeparatedList(OnapCommandHttpConstants.HTTP_MANDATORY_SECTIONS), OnapCommandHttpConstants.HTTP); + errorList.addAll(validateHttpSchemaSection(values)); } for (Map.Entry entry1 : valMap.entrySet()) { String key1 = entry1.getKey(); diff --git a/profiles/http/src/main/resources/open-cli-schema/http/default_input_parameters_http.yaml b/profiles/http/src/main/resources/open-cli-schema/http/default_input_parameters_http.yaml index 9029e273..69e82b3b 100644 --- a/profiles/http/src/main/resources/open-cli-schema/http/default_input_parameters_http.yaml +++ b/profiles/http/src/main/resources/open-cli-schema/http/default_input_parameters_http.yaml @@ -1,10 +1,5 @@ open_cli_schema_version: 1.0 -info: - product: open-cli - service: default-param - ignore: true - parameters: - name: host-username type: string -- cgit 1.2.3-korg