diff options
author | franciscovila <javier.paradela.vila@est.tech> | 2023-06-14 17:17:02 +0100 |
---|---|---|
committer | Vasyl Razinkov <vasyl.razinkov@est.tech> | 2023-06-15 15:46:04 +0000 |
commit | 6843db5fbca71b3a30fabb4dd97f818dc4d6b72d (patch) | |
tree | 64ae09ac4e88ce4b2ce1e54855f832e525e2f1b1 /catalog-be/src/main/java/org | |
parent | 56288ac75d57367587442043743879b8649055ac (diff) |
Node filter boolean values output as strings
Issue-ID: SDC-4535
Signed-off-by: franciscovila <javier.paradela.vila@est.tech>
Change-Id: Iaa5d1f8f5e389ac31bab81317cd8ef2591f345fd
Diffstat (limited to 'catalog-be/src/main/java/org')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java index 4b8249823e..f85e435e1c 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java @@ -1792,6 +1792,10 @@ public class ToscaExportHandler { ConstraintType.MAX_LENGTH.getType().equals(filterConstraint.getOperator().getType())) { filterConstraint.setValue(Integer.valueOf(String.valueOf(filterConstraint.getValue()))); } + if (doesTypeNeedConvertingToBoolean(filterConstraint.getOriginalType())) { + filterConstraint.setValue(ToscaType.getToscaType(filterConstraint.getOriginalType()).convert( + String.valueOf(filterConstraint.getValue()))); + } return Map.of(filterConstraint.getOperator().getType(), filterConstraint.getValue()); } @@ -1802,6 +1806,10 @@ public class ToscaExportHandler { return ToscaType.INTEGER.getType().equals(propertyType) || ToscaType.FLOAT.getType().equals(propertyType); } + private static boolean doesTypeNeedConvertingToBoolean(String propertyType) { + return ToscaType.BOOLEAN.getType().equals(propertyType); + } + private Map<String, String[]> buildSubstitutionMappingPropertyMapping(final Component component) { if (component == null || CollectionUtils.isEmpty(component.getInputs())) { return Collections.emptyMap(); |