From be7ba43b95f13bb390cdd77a15c35072781e5546 Mon Sep 17 00:00:00 2001 From: JvD_Ericsson Date: Mon, 21 Nov 2022 09:55:26 +0000 Subject: Fix numeric constraint values generated as strings When importing a vfc the property constraints are now checked to see if they are the same type as the property If not it will attempt to convert to that type Issue-ID: SDC-4274 Signed-off-by: JvD_Ericsson Change-Id: I32c1d930166d10142ad9ca6914550c7946e9128c --- .../be/plugins/etsi/nfv/nsd/generator/NsDescriptorGeneratorImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'catalog-be-plugins') diff --git a/catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/main/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/NsDescriptorGeneratorImpl.java b/catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/main/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/NsDescriptorGeneratorImpl.java index 9572c44a6b..eb601d836d 100644 --- a/catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/main/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/NsDescriptorGeneratorImpl.java +++ b/catalog-be-plugins/etsi-nfv-nsd-csar-plugin/src/main/java/org/openecomp/sdc/be/plugins/etsi/nfv/nsd/generator/NsDescriptorGeneratorImpl.java @@ -151,12 +151,12 @@ public class NsDescriptorGeneratorImpl implements NsDescriptorGenerator { return returnValueOnError; } final ToscaPropertyConstraintValidValues validValuesConstraint = (ToscaPropertyConstraintValidValues) toscaPropertyConstraint; - final List validValues = validValuesConstraint.getValidValues(); + final List validValues = validValuesConstraint.getValidValues(); if (CollectionUtils.isEmpty(validValues)) { LOGGER.error(errorMsg); return returnValueOnError; } - return validValues.get(0); + return String.valueOf(validValues.get(0)); } private ToscaTemplate createNetworkServiceDescriptor(final Component component, final List vnfDescriptorList) throws NsdException { -- cgit 1.2.3-korg