diff options
author | imamSidero <imam.hussain@est.tech> | 2023-02-17 17:03:38 +0000 |
---|---|---|
committer | Vasyl Razinkov <vasyl.razinkov@est.tech> | 2023-02-21 18:10:23 +0000 |
commit | 3eb6f41297cedc038d18582d31d65dab05b351b8 (patch) | |
tree | 931a757472ddf6c63882357abbc390a18caf90d2 /catalog-be/src | |
parent | 45ae8a3555d49190622767a548d1c4697a379c9b (diff) |
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 <imam.hussain@est.tech>
Change-Id: I320b2f2bdb8c8e236e7cd232902a4a07d0c245c8
Diffstat (limited to 'catalog-be/src')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtil.java | 24 |
1 files changed, 13 insertions, 11 deletions
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); |