Skip to content

Commit

Permalink
Do not rename types within an identical namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
henryolik committed Oct 18, 2023
1 parent 186ee86 commit f56e8ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xsdgen/xsdgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ func (cfg *Config) gen(primaries, deps []xsd.Schema) (*Code, error) {
}

rename := make(map[xml.Name]string)
types := make(map[string]bool)
types := make(map[string]string)

// Check for any duplicate names between namespaces
for i, primary := range primaries {
for k, _ := range primary.Types {
if k.Local != "_self" && types[k.Local] {
if !strings.HasPrefix(k.Local, "_") && types[k.Local] != "" && types[k.Local] != k.Space {
rename[k] = k.Local + fmt.Sprint(i)
} else {
types[k.Local] = true
types[k.Local] = k.Space
}
}
}
Expand Down

0 comments on commit f56e8ac

Please sign in to comment.