diff options
Diffstat (limited to 'catalog-model/src/main')
-rw-r--r-- | catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ModelOperation.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ModelOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ModelOperation.java index 2e35c30e06..311b4719bd 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ModelOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ModelOperation.java @@ -297,7 +297,10 @@ public class ModelOperation { rebuiltModelImportList = new ArrayList<>(modelImportList); } - final Map<String, Object> typesYamlMap = new Yaml().loadAs(typesYaml, Map.class); + Map<String, Object> typesYamlMap = new Yaml().loadAs(typesYaml, Map.class); + if (typesYamlMap.containsKey("data_types")){ + typesYamlMap = (Map<String, Object>) typesYamlMap.get("data_types"); + } removeExistingTypesFromDefaultImports(elementTypeEnum, typesYamlMap, rebuiltModelImportList); final Map<String, Object> originalContent = new Yaml().load(additionalTypeDefinitionsImport.getContent()); @@ -396,7 +399,10 @@ public class ModelOperation { final Map<String, Object> typesToUpate = new HashMap<>(); - final Map<String, Object> newTypesYaml = new Yaml().load(typesYaml); + Map<String, Object> newTypesYaml = new Yaml().load(typesYaml); + if (newTypesYaml.containsKey("data_types")){ + newTypesYaml = (Map<String, Object>) newTypesYaml.get("data_types"); + } newTypesYaml.entrySet().stream().filter(entry -> existingTypeNames.contains(entry.getKey())).forEach(newTypeToUpdate -> { final Map<String, Object> propertiesInNewDef = (Map<String, Object>) ((Map<String, Object>) newTypeToUpdate.getValue()).get("properties"); |