aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-model/src
diff options
context:
space:
mode:
authoreschcam <cameron.scholes@est.tech>2023-01-25 14:29:42 +0000
committerMichael Morris <michael.morris@est.tech>2023-01-27 18:58:17 +0000
commite3a2b947dfaa8da5e533686508397563a3034c0b (patch)
treeddb8f3001b31a997bba2a1ce8843e6c99f076409 /catalog-model/src
parent43ffce5d0d30872446c51afaf786d5cfad4378be (diff)
Fix int and float constraints generating as strings
Convert integers and float constraints before generating TOSCA file Issue-ID: SDC-4318 Signed-off-by: eschcam <cameron.scholes@est.tech> Change-Id: Iba412930fe8782ac2cee5b5ce99faae545ca0d57
Diffstat (limited to 'catalog-model/src')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/InRangeConstraint.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/InRangeConstraint.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/InRangeConstraint.java
index 19e215364c..4f362b9dfb 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/InRangeConstraint.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/InRangeConstraint.java
@@ -124,6 +124,8 @@ public class InRangeConstraint extends AbstractPropertyConstraint {
ToscaType toscaType = ToscaType.getToscaType(propertyType);
try {
inRange.replaceAll(obj -> toscaType.convert(String.valueOf(obj)));
+ min = ConstraintUtil.convertToComparable(toscaType, String.valueOf(inRange.get(0)));
+ max = ConstraintUtil.convertToComparable(toscaType, String.valueOf(inRange.get(1)));
} catch (Exception e) {
throw new ConstraintValueDoNotMatchPropertyTypeException(
"inRange constraint has invalid values <" + inRange + "> property type is <" + propertyType + ">");