diff options
author | Sébastien Determe <sebastien.determe@intl.att.com> | 2019-03-19 13:57:29 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-19 13:57:29 +0000 |
commit | 8d2cd45bf8d3d08b8213aa2b38847f1180eea6d3 (patch) | |
tree | 9b45406752c8f001822ed84aa63c1669386b89c0 /src | |
parent | 0c5293804eac938b6528f2afe293f3992764b651 (diff) | |
parent | 8f95f6c9359c3551c6c6f28eb997ce03bba46bb1 (diff) |
Merge "Fix tosca parser"
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/onap/clamp/clds/tosca/ToscaYamlToJsonConvertor.java | 9 | ||||
-rw-r--r-- | src/test/resources/tosca/tosca_example.yaml | 2 |
2 files changed, 2 insertions, 9 deletions
diff --git a/src/main/java/org/onap/clamp/clds/tosca/ToscaYamlToJsonConvertor.java b/src/main/java/org/onap/clamp/clds/tosca/ToscaYamlToJsonConvertor.java index 8a172abb..16a817ea 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/ToscaYamlToJsonConvertor.java +++ b/src/main/java/org/onap/clamp/clds/tosca/ToscaYamlToJsonConvertor.java @@ -109,19 +109,12 @@ public class ToscaYamlToJsonConvertor { LinkedHashMap<String, Object> dataNodes) { map.entrySet().stream().forEach(n -> { if (n.getKey().contains(ToscaSchemaConstants.NODE_TYPES) && n.getValue() instanceof Map) { - parseNodeAndDataType((LinkedHashMap<String, Object>) n.getValue(), nodeTypes, dataNodes); - } else if (n.getKey().contains(ToscaSchemaConstants.DATA_TYPES) && n.getValue() instanceof Map) { - parseNodeAndDataType((LinkedHashMap<String, Object>) n.getValue(), nodeTypes, dataNodes); - } else if (n.getKey().contains(ToscaSchemaConstants.POLICY_NODE)) { - nodeTypes.put(n.getKey(), n.getValue()); - } else if (n.getKey().contains(ToscaSchemaConstants.POLICY_DATA)) { - dataNodes.put(n.getKey(), n.getValue()); } @@ -149,7 +142,7 @@ public class ToscaYamlToJsonConvertor { .getValue(); if (parentPropertiesMap.containsKey(ToscaSchemaConstants.TYPE) && ((String) parentPropertiesMap.get(ToscaSchemaConstants.TYPE)) - .contains(ToscaSchemaConstants.TYPE_LIST) + .contains(ToscaSchemaConstants.TYPE_MAP) && parentPropertiesMap.containsKey(ToscaSchemaConstants.ENTRY_SCHEMA)) { parentPropertiesMap = (LinkedHashMap<String, Object>) parentPropertiesMap .get(ToscaSchemaConstants.ENTRY_SCHEMA); diff --git a/src/test/resources/tosca/tosca_example.yaml b/src/test/resources/tosca/tosca_example.yaml index 571986cd..699cffd7 100644 --- a/src/test/resources/tosca/tosca_example.yaml +++ b/src/test/resources/tosca/tosca_example.yaml @@ -8,7 +8,7 @@ policy_types: version: 1.0.0 properties: tca_policy: - type: list + type: map description: TCA Policy JSON entry_schema: type: onap.datatypes.monitoring.tca_policy |