Support a custom yaml value in tosca function
[sdc.git] / catalog-be / src / main / java / org / openecomp / sdc / be / tosca / PropertyConvertor.java
index 5bb3d11..148e699 100644 (file)
@@ -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;