diff --git a/rosetta-runtime/src/main/java/com/rosetta/util/serialisation/TypeXMLConfiguration.java b/rosetta-runtime/src/main/java/com/rosetta/util/serialisation/TypeXMLConfiguration.java index ead845a76..d7d8b6339 100644 --- a/rosetta-runtime/src/main/java/com/rosetta/util/serialisation/TypeXMLConfiguration.java +++ b/rosetta-runtime/src/main/java/com/rosetta/util/serialisation/TypeXMLConfiguration.java @@ -32,6 +32,16 @@ public class TypeXMLConfiguration { private final Optional> enumValues; @JsonCreator + @Deprecated + public TypeXMLConfiguration( + @JsonProperty("substitutionFor") Optional substitutionFor, + @JsonProperty("xmlElementName") Optional xmlElementName, + @JsonProperty("xmlRootElementName") @Deprecated Optional xmlRootElementName, + @JsonProperty("xmlAttributes") Optional> xmlAttributes, + @JsonProperty("attributes") Optional> attributes, + @JsonProperty("enumValues") Optional> enumValues) { + this(substitutionFor, xmlElementName.isPresent() ? xmlElementName : xmlRootElementName, xmlAttributes, attributes, enumValues); + } public TypeXMLConfiguration( @JsonProperty("substitutionFor") Optional substitutionFor, @JsonProperty("xmlElementName") Optional xmlElementName, diff --git a/rosetta-tools/src/main/java/com/regnosys/rosetta/tools/modelimport/ImportTargetConfig.java b/rosetta-tools/src/main/java/com/regnosys/rosetta/tools/modelimport/ImportTargetConfig.java index 71df078dd..99ce34a4a 100644 --- a/rosetta-tools/src/main/java/com/regnosys/rosetta/tools/modelimport/ImportTargetConfig.java +++ b/rosetta-tools/src/main/java/com/regnosys/rosetta/tools/modelimport/ImportTargetConfig.java @@ -1,5 +1,6 @@ package com.regnosys.rosetta.tools.modelimport; +import java.util.Collections; import java.util.Map; import java.util.Objects; @@ -20,7 +21,7 @@ public ImportTargetConfig( @JsonProperty("preferences") ImportTargetPreferences preferences) { this.namespace = namespace; this.namespaceDefinition = namespaceDefinition; - this.nameOverrides = nameOverrides; + this.nameOverrides = nameOverrides == null ? Collections.emptyMap() : nameOverrides; this.preferences = preferences == null ? new ImportTargetPreferences(null, null, null) : preferences; } diff --git a/rosetta-tools/src/test/java/com/regnosys/rosetta/tools/modelimport/ImportConfigTest.java b/rosetta-tools/src/test/java/com/regnosys/rosetta/tools/modelimport/ImportConfigTest.java index 42e68a9c5..d49e2e579 100644 --- a/rosetta-tools/src/test/java/com/regnosys/rosetta/tools/modelimport/ImportConfigTest.java +++ b/rosetta-tools/src/test/java/com/regnosys/rosetta/tools/modelimport/ImportConfigTest.java @@ -22,6 +22,7 @@ void shouldLoadConfigFromFile() throws FileNotFoundException, IOException { // assert assertEquals("test.ns", config.getTarget().getNamespace()); assertEquals("Test namespace definition", config.getTarget().getNamespaceDefinition()); + assertNotNull(config.getTarget().getNameOverrides()); assertNotNull(config.getTarget().getPreferences()); }