From b2baffc887a7f0bd22345e334917c8768048fc39 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Wed, 31 Jan 2018 18:02:48 +0530 Subject: Add validation for attributes missing in result Issue-ID: CLI-61 Change-Id: I2229a6dde2be0b6fcac38aa7abaf4c518d15e55c Signed-off-by: Kanagaraj Manickam k00365106 --- .../java/org/onap/cli/fw/http/schema/OnapCommandSchemaHttpLoader.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'profiles/http/src') 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 6dd15884..52ced397 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 @@ -332,6 +332,9 @@ public class OnapCommandSchemaHttpLoader { List invaliResultMapParams = resultMapParams.stream() .filter(p -> !resultAttNames.contains(p)).collect(Collectors.toList()); + List attributesMissing = resultAttNames.stream() + .filter(p -> !resultMapParams.contains(p)).collect(Collectors.toList()); + invaliResultMapParams.addAll(attributesMissing); if (!invaliResultMapParams.isEmpty()) { OnapCommandUtils.throwOrCollect(new OnapCommandHttpInvalidResultMap(invaliResultMapParams), errorList, true); -- cgit 1.2.3-korg