<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>
} else {
PropertyDefinition propertyDefinition = new PropertyDefinition();
propertyDefinition.setType(operationInputDefinition.getType());
+ propertyDefinition.setSchema(operationInputDefinition.getSchema());
propertyDefinition.setValue(value);
propertyDefinition.setName(operationInputDefinition.getName());
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 {
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;
return constraints;
}
+ public List<PropertyConstraint> safeGetConstraints() {
+ return CollectionUtils.safeGetList(constraints);
+ }
+
public void setConstraints(List<PropertyConstraint> constraints) {
this.constraints = constraints;
}