From 3eb6f41297cedc038d18582d31d65dab05b351b8 Mon Sep 17 00:00:00 2001 From: imamSidero Date: Fri, 17 Feb 2023 17:03:38 +0000 Subject: Fix issue on adding values to complex properties in Property Assignment value field for complex types are restored and validation for the complex type is fixed Issue-ID: SDC-4400 Signed-off-by: Imam hussain Change-Id: I320b2f2bdb8c8e236e7cd232902a4a07d0c245c8 --- .../PropertyValueConstraintValidationUtil.java | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'catalog-be/src/main/java') 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 a25a332b9e..6c820a1af2 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 @@ -371,17 +371,19 @@ public class PropertyValueConstraintValidationUtil { final PropertyDefinition propertyCopyWithNewValue = copyPropertyWithNewValue(propertyDefinition, objectMapper.writeValueAsString(value),mapKey); propertyCopyWithNewValue.setToscaSubPath(mapKey); - if (ToscaType.isPrimitiveType(schemaType)) { - evaluateCollectionPrimitiveSchemaType(propertyCopyWithNewValue, schemaType); - } else if (ToscaType.isCollectionType(schemaType)) { - propertyCopyWithNewValue.setType(schemaType); - propertyCopyWithNewValue.setSchemaType(propertyDefinition.getSchemaProperty().getSchemaType()); - evaluateCollectionTypeProperties(propertyCopyWithNewValue); - } else { - propertyCopyWithNewValue.setType(schemaType); - completePropertyName.append(UNDERSCORE); - completePropertyName.append(propertyCopyWithNewValue.getName()); - evaluateComplexTypeProperties(propertyCopyWithNewValue); + if (isPropertyNotMappedAsInput(propertyCopyWithNewValue)) { + if (ToscaType.isPrimitiveType(schemaType)) { + evaluateCollectionPrimitiveSchemaType(propertyCopyWithNewValue, schemaType); + } else if (ToscaType.isCollectionType(schemaType)) { + propertyCopyWithNewValue.setType(schemaType); + propertyCopyWithNewValue.setSchemaType(propertyDefinition.getSchemaProperty().getSchemaType()); + evaluateCollectionTypeProperties(propertyCopyWithNewValue); + } else { + propertyCopyWithNewValue.setType(schemaType); + completePropertyName.append(UNDERSCORE); + completePropertyName.append(propertyCopyWithNewValue.getName()); + evaluateComplexTypeProperties(propertyCopyWithNewValue); + } } } catch (final Exception e) { logger.debug(e.getMessage(), e); -- cgit 1.2.3-korg