summaryrefslogtreecommitdiffstats
path: root/catalog-be/src
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
index d228db5f4b..cdd5d60ed4 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
@@ -814,8 +814,8 @@ public class ToscaExportHandler {
toscaDataType.setProperties(dataType.getProperties().stream()
.collect(Collectors.toMap(
PropertyDataDefinition::getName,
- s -> propertyConvertor
- .convertProperty(dataTypes, s, PropertyType.PROPERTY)
+ s -> propertyConvertor.convertProperty(dataTypes, s, PropertyType.PROPERTY),
+ (toscaPropertyTobeValidated, toscaProperty) -> validateToscaProperty(privateDataTypes, toscaPropertyTobeValidated, toscaProperty)
)));
}
toscaDataTypeMap.put(dataType.getName(), toscaDataType);
@@ -827,6 +827,13 @@ public class ToscaExportHandler {
return convertReqCapAndTypeName(componentsCache, component, toscaNode, nodeTypes, toscaNodeType, dataTypes);
}
+ private ToscaProperty validateToscaProperty(final List<DataTypeDefinition> privateDataTypes, final ToscaProperty toscaPropertyTobeValidated,
+ final ToscaProperty toscaProperty) {
+ final Optional<DataTypeDefinition> match = privateDataTypes.stream()
+ .filter(dataType -> dataType.getName().equals(toscaPropertyTobeValidated.getType())).findFirst();
+ return match.isPresent() ? toscaPropertyTobeValidated : toscaProperty;
+ }
+
private Map<String, ToscaAttribute> convertToToscaAttributes(final List<AttributeDefinition> attributeList,
final Map<String, DataTypeDefinition> dataTypes) {
if (CollectionUtils.isEmpty(attributeList)) {