aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src
diff options
context:
space:
mode:
authoraribeiro <anderson.ribeiro@est.tech>2021-11-30 08:43:42 +0000
committerMichael Morris <michael.morris@est.tech>2021-12-09 12:50:38 +0000
commit6c682e71e580cf051e7ab30ed7a89b03ca46277b (patch)
tree16fac3c52db67e31d3560dd8029d6be2e791c934 /catalog-be/src
parent8b1002a99724180cc9c134a04a5eb0763fde872c (diff)
Fix generated tosca and Required fields validation
Fix Incorrect properties entry on the interface operation implementation definition and Required fields validation. Issue-ID: SDC-3796 Signed-off-by: aribeiro <anderson.ribeiro@est.tech> Change-Id: Ib6624fb884181612b2d94970d3cca28af839151d
Diffstat (limited to 'catalog-be/src')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java6
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaArtifactDefinition.java3
2 files changed, 4 insertions, 5 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java
index 52e7562bbe..919a5bca00 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java
@@ -38,7 +38,6 @@ import org.apache.commons.lang3.math.NumberUtils;
import org.openecomp.sdc.be.datatypes.elements.InputDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.OperationInputDefinition;
-import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.ComponentInstance;
import org.openecomp.sdc.be.model.DataTypeDefinition;
@@ -313,8 +312,9 @@ public class InterfacesOperationsConverter {
final ToscaArtifactDefinition toscaArtifactDefinition) {
final var properties = operationEntry.getValue().getImplementation().getProperties();
if (CollectionUtils.isNotEmpty(properties)) {
- final Map<String, PropertyDataDefinition> propertiesMap = new HashMap<>();
- properties.forEach(propertyDefinition -> propertiesMap.put(propertyDefinition.getName(), propertyDefinition));
+ final Map<String, String> propertiesMap = new HashMap<>();
+ properties.stream().filter(propertyDataDefinition -> StringUtils.isNotEmpty(propertyDataDefinition.getValue()))
+ .forEach(propertyDataDefinition -> propertiesMap.put(propertyDataDefinition.getName(), propertyDataDefinition.getValue()));
toscaArtifactDefinition.setProperties(propertiesMap);
}
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaArtifactDefinition.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaArtifactDefinition.java
index f49d0478b9..689dc91d23 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaArtifactDefinition.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaArtifactDefinition.java
@@ -23,7 +23,6 @@ package org.openecomp.sdc.be.tosca.model;
import java.util.Map;
import lombok.Getter;
import lombok.Setter;
-import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
@Getter
@Setter
@@ -37,5 +36,5 @@ public class ToscaArtifactDefinition {
private String artifact_version;
private String checksum;
private String checksum_algorithm;
- private Map<String, PropertyDataDefinition> properties;
+ private Map<String, String> properties;
}