summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--catalog-be/pom.xml5
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java1
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtil.java8
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/DataTypeDefinition.java5
4 files changed, 15 insertions, 4 deletions
diff --git a/catalog-be/pom.xml b/catalog-be/pom.xml
index e32d514842..dcd4c586cb 100644
--- a/catalog-be/pom.xml
+++ b/catalog-be/pom.xml
@@ -624,6 +624,11 @@
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson.mapper.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
+ <version>${commons.collections.version}</version>
+ </dependency>
</dependencies>
<build>
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java
index a586e23da7..cad9a92ab3 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java
@@ -700,6 +700,7 @@ public class ServiceBusinessLogic extends ComponentBusinessLogic {
} else {
PropertyDefinition propertyDefinition = new PropertyDefinition();
propertyDefinition.setType(operationInputDefinition.getType());
+ propertyDefinition.setSchema(operationInputDefinition.getSchema());
propertyDefinition.setValue(value);
propertyDefinition.setName(operationInputDefinition.getName());
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtil.java b/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtil.java
index 073e469c1e..72342e642f 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtil.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtil.java
@@ -106,13 +106,13 @@ public class PropertyValueConstraintValidationUtil {
if (Objects.nonNull(propertyDefinition)) {
if (ToscaType.isPrimitiveType(propertyDefinition.getType())) {
propertyDefinition.setConstraints(
- org.openecomp.sdc.be.dao.utils.CollectionUtils.merge(propertyDefinition.getConstraints(),
- dataTypeDefinitionCache.get(propertyDefinition.getType()).getConstraints()));
+ org.openecomp.sdc.be.dao.utils.CollectionUtils.merge(propertyDefinition.safeGetConstraints(),
+ dataTypeDefinitionCache.get(propertyDefinition.getType()).safeGetConstraints()));
evaluateConstraintsOnProperty(propertyDefinition);
} else if (ToscaType.isCollectionType(propertyDefinition.getType())) {
propertyDefinition.setConstraints(
- org.openecomp.sdc.be.dao.utils.CollectionUtils.merge(propertyDefinition.getConstraints(),
- dataTypeDefinitionCache.get(propertyDefinition.getType()).getConstraints()));
+ org.openecomp.sdc.be.dao.utils.CollectionUtils.merge(propertyDefinition.safeGetConstraints(),
+ dataTypeDefinitionCache.get(propertyDefinition.getType()).safeGetConstraints()));
evaluateConstraintsOnProperty(propertyDefinition);
evaluateCollectionTypeProperties(propertyDefinition);
} else {
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/DataTypeDefinition.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/DataTypeDefinition.java
index 4dc952d59b..a54e3264e2 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/DataTypeDefinition.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/DataTypeDefinition.java
@@ -20,6 +20,7 @@
package org.openecomp.sdc.be.model;
+import org.openecomp.sdc.be.dao.utils.CollectionUtils;
import org.openecomp.sdc.be.datatypes.elements.DataTypeDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
@@ -55,6 +56,10 @@ public class DataTypeDefinition extends DataTypeDataDefinition {
return constraints;
}
+ public List<PropertyConstraint> safeGetConstraints() {
+ return CollectionUtils.safeGetList(constraints);
+ }
+
public void setConstraints(List<PropertyConstraint> constraints) {
this.constraints = constraints;
}