aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java9
1 files changed, 8 insertions, 1 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 bb89d99b2e..734b5ac7be 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
@@ -79,6 +79,7 @@ import org.openecomp.sdc.common.log.wrappers.Logger;
import org.openecomp.sdc.tosca.datatypes.ToscaFunctions;
import org.springframework.stereotype.Service;
import org.yaml.snakeyaml.Yaml;
+import org.yaml.snakeyaml.scanner.ScannerException;
@Service
public class PropertyConvertor {
@@ -321,7 +322,13 @@ public class PropertyConvertor {
} catch (JsonParseException e) {
log.trace("{} not parsable as JSON. Convert as YAML instead", value);
- return new Yaml().load(value);
+ try {
+ return new Yaml().load(value);
+ } catch (ScannerException ex) {
+ log.trace("{} not parsable as YAML. Returning as string", value);
+ return value;
+ }
+
} catch (Exception e) {
log.debug("convertToToscaValue failed to parse json value :", e);
return null;