-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
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
xsdgen: issues with wildcards & embedded fields #31
Comments
Looking into this further, I believe I've found the issue. With the commit ed9a5b5, I used something like the following strategy to override unmarshalling for individual fields in a struct:
Notably, the local type https://play.golang.org/p/0el2d1S145 In short, methods of the embedded structs are not silenced by the So, the workaround here would be to forgo struct embedding, and expand the base type that a complexType extends. The This will make the generated files larger for complex schema, and make the type hierarchy less obvious. However, I don't see a better alternative. |
Fixed with b12a23a |
The
dash
branch contains the DASH-MPD XSD and sample data in thegentest
directory.Currently the tests fail due to an invalid marshalling of the
SegmentList
element. It is supposed to generate something like this:Instead we get this:
This is due to the
<SegmentURL>
items being unmarshalled into the wrong place. Here's the the relevant type declarations:Within MultipleSegmentBaseType is the following:
This feels like a possible bug, or at least, unexpected behavior in the
encoding/xml
package; it is dropping theSegmentURL
items into this wildcard field, even though further downSegmentListType
there is a more specific field matching those items. This is probably due to the fact that the wildcard field is in an embedded type.The text was updated successfully, but these errors were encountered: