-
Notifications
You must be signed in to change notification settings - Fork 202
Closed
Description
In an application where the XmlSchemaSet contains several xml schema files (the main schema file references other xml schema files) I get a type name ("AnyType") twice in the list with ambiguous types. This leads to an exception in the GetQualifiedName() function, as schemaType is null.
Please modify the AddXmlRootAttributeToAmbiguousTypes() function in ModelBuilder.cs from:
private void AddXmlRootAttributeToAmbiguousTypes()
{
var ambiguousTypes = Types.Values.Where(t => t.RootElementName == null && !t.IsAbstractRoot && t is not InterfaceModel).GroupBy(t => t.Name);
foreach (var ambiguousTypeGroup in ambiguousTypes)
{
var types = ambiguousTypeGroup.ToList();
if (types.Count == 1)
{
continue;
}
foreach (var typeModel in types)
typeModel.RootElementName = typeModel.GetQualifiedName();
}
}
to:
private void AddXmlRootAttributeToAmbiguousTypes()
{
var ambiguousTypes = Types.Values.Where(t => t.RootElementName == null && !t.IsAbstractRoot && t is not InterfaceModel).GroupBy(t => t.Name);
foreach (var ambiguousTypeGroup in ambiguousTypes)
{
var types = ambiguousTypeGroup.DistinctBy(x => x.Name).ToList();
if (types.Count == 1)
{
continue;
}
foreach (var typeModel in types)
typeModel.RootElementName = typeModel.GetQualifiedName();
}
}
Metadata
Metadata
Assignees
Labels
No labels