You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xsdgen does not ensure struct fields for complex types are named uniquely, so generated code for a type with an attribute and element of the same name will not compile. Using a simple xsd like this:
package ws
type MyType2 struct {
Title string `xml:"title,attr"`
Title string `xml:"http://example.org/ title"`
}
Which is not valid code. For the attribute/element case in the example, we can append "Attr" to the field name for the attribute. I can't think of other type declarations that would cause this problem, but it's something to be mindful of if we add more support for unions. The relevant portion of the XSD spec is here, I think.
The text was updated successfully, but these errors were encountered:
xsdgen
does not ensure struct fields for complex types are named uniquely, so generated code for a type with an attribute and element of the same name will not compile. Using a simple xsd like this:Generates this:
Which is not valid code. For the attribute/element case in the example, we can append "Attr" to the field name for the attribute. I can't think of other type declarations that would cause this problem, but it's something to be mindful of if we add more support for unions. The relevant portion of the XSD spec is here, I think.
The text was updated successfully, but these errors were encountered: