summaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules
diff options
context:
space:
mode:
authorBrinda Santh Muthuramalingam <brindasanth@in.ibm.com>2019-07-16 21:11:02 +0000
committerGerrit Code Review <gerrit@onap.org>2019-07-16 21:11:02 +0000
commit22494ac1155031e9df5860f6909eb630c1391ff9 (patch)
tree68327e4adb6647daf15580b30e06d12cd628f681 /ms/controllerblueprints/modules
parent0cdea534624e251f8a7445b146e77a0f635755b8 (diff)
parentc15af9a019ae786bc6970fa1184361c1be96693a (diff)
Merge "Fixed bugs/vulnerabilities reported by SonarQube"
Diffstat (limited to 'ms/controllerblueprints/modules')
-rw-r--r--ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/cds/controllerblueprints/service/common/SwaggerGenerator.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/cds/controllerblueprints/service/common/SwaggerGenerator.java b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/cds/controllerblueprints/service/common/SwaggerGenerator.java
index abf774981..38216a616 100644
--- a/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/cds/controllerblueprints/service/common/SwaggerGenerator.java
+++ b/ms/controllerblueprints/modules/service/src/main/java/org/onap/ccsdk/cds/controllerblueprints/service/common/SwaggerGenerator.java
@@ -155,19 +155,16 @@ public class SwaggerGenerator {
defProperty = new StringProperty();
}
} else if (BluePrintTypes.validCollectionTypes().contains(propertyDefinition.getType())) {
- ArrayProperty arrayProperty = new ArrayProperty();
+ Optional<Property> innerType = Optional.empty();
if (propertyDefinition.getEntrySchema() != null) {
String entrySchema = propertyDefinition.getEntrySchema().getType();
if (!BluePrintTypes.validPrimitiveTypes().contains(entrySchema)) {
- Property innerType = new RefProperty("#/definitions/" + entrySchema);
- arrayProperty.setItems(innerType);
- } else {
- Property innerType = new StringProperty();
- arrayProperty.setItems(innerType);
+ innerType = Optional.of(new RefProperty("#/definitions/" + entrySchema));
}
- defProperty = arrayProperty;
}
-
+ ArrayProperty arrayProperty = new ArrayProperty();
+ arrayProperty.setItems(innerType.orElseGet(StringProperty::new));
+ defProperty = arrayProperty;
} else {
defProperty = new RefProperty("#/definitions/" + propertyDefinition.getType());
}