We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi!
The tool is installed via
go install github.com/gocomply/xsd2go/cli/gocomply_xsd2go
Consider the following:
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ak="http://www.bafa.de/ausfuhrkontrolle/schemas" targetNamespace="http://www.bafa.de/ausfuhrkontrolle/schemas" elementFormDefault="qualified" attributeFormDefault="qualified" version="1.0"> <xsd:annotation/> <xsd:complexType name="AAA"> <xsd:annotation/> <xsd:sequence> <xsd:element name="List" minOccurs="0"> <xsd:annotation/> <xsd:complexType> <xsd:sequence> <xsd:element name="CCC" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> <xsd:complexType name="BBB"> <xsd:annotation/> <xsd:sequence> <xsd:element name="List" minOccurs="0"> <xsd:annotation/> <xsd:complexType> <xsd:sequence> <xsd:element name="DDD" type="xsd:int" minOccurs="1" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:schema>
This results in:
// Element type List struct { XMLName xml.Name `xml:"List"` Ccc []string `xml:",any"` } // Element type List struct { XMLName xml.Name `xml:"List"` Ddd []int `xml:",any"` } [...]
While i would expect this to be prefixed, or solved via anonymous structs, like e.g.:
// Element type AaaList struct { XMLName xml.Name `xml:"List"` Ccc []string `xml:",any"` } // Element type BbbList struct { XMLName xml.Name `xml:"List"` Ddd []int `xml:",any"` } [...]
or
// XSD ComplexType declarations type Aaa struct { XMLName xml.Name List *struct { XMLName xml.Name `xml:"List"` Ccc []string `xml:",any"` } `xml:",any"` } type Bbb struct { XMLName xml.Name List *struct { XMLName xml.Name `xml:"List"` Ddd []int `xml:",any"` } `xml:",any"` } [...]
Thanks for consideration!
The text was updated successfully, but these errors were encountered:
One way would be to set nameOverride for the dupe elements so no duplicates are returned by GoName().
nameOverride
GoName()
Sorry, something went wrong.
Fix GoComply#129
e932368
Tested this change locally, seems to work. Can it be merged? Unit test is included.
No branches or pull requests
Hi!
The tool is installed via
Consider the following:
This results in:
While i would expect this to be prefixed, or solved via anonymous structs, like e.g.:
or
Thanks for consideration!
The text was updated successfully, but these errors were encountered: