diff options
author | andre.schmid <andre.schmid@est.tech> | 2022-07-18 17:25:41 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2022-07-29 20:08:14 +0000 |
commit | 3f9669fdae5f7c6cb1bfe34742df35dfe3a14aa7 (patch) | |
tree | 307686e72403ee837fd342efb9865b0b6a83da7c /catalog-be | |
parent | 22d13840722a4020b1aaf75eeff3622e83c4b6d4 (diff) |
Support a custom yaml value in tosca function
Allows to add a custom YAML value to properties in the TOSCA function
feature.
Change-Id: I15e65088a18537d9832428717be826ac0ef6049a
Issue-ID: SDC-4099
Signed-off-by: André Schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-be')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java index 5bb3d116f8..148e69907c 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java @@ -34,6 +34,7 @@ import java.util.function.Supplier; import org.apache.commons.lang3.StringUtils; import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition; +import org.openecomp.sdc.be.datatypes.elements.ToscaFunctionType; import org.openecomp.sdc.be.model.Component; import org.openecomp.sdc.be.model.DataTypeDefinition; import org.openecomp.sdc.be.model.PropertyDefinition; @@ -115,6 +116,9 @@ public class PropertyConvertor { return null; } } + if (property.isToscaFunction() && property.getToscaFunction().getType() == ToscaFunctionType.YAML) { + return new Yaml().load(property.getValue()); + } try { ToscaMapValueConverter mapConverterInst = ToscaMapValueConverter.getInstance(); ToscaValueConverter innerConverter = null; |