Is your feature request related to a problem? Please describe.
I've got an XSD using xsd:choice which isn't currently supported by xgen. Choices don't provide much as far as something that needs to be represented in generated code except for the plurality since a choice can be something like:
In the example case above, the generated code should be plural versions of myType1 and myType2 because the choice container says that maxOccurs is unbounded.
Describe the solution you'd like
xgen should see choice elements and propagate the choice's plurality to the elements it contains. Since xgen doesn't generate anything regarding validation of min/max occurrences, this should be all there is to it to support xsd:choice elements.
Generated code for the example above (Go) would be something like:
Is your feature request related to a problem? Please describe.
I've got an XSD using xsd:choice which isn't currently supported by xgen.
Choice
s don't provide much as far as something that needs to be represented in generated code except for the plurality since a choice can be something like:In the example case above, the generated code should be plural versions of
myType1
andmyType2
because the choice container says that maxOccurs is unbounded.Describe the solution you'd like xgen should see
choice
elements and propagate the choice's plurality to the elements it contains. Since xgen doesn't generate anything regarding validation of min/max occurrences, this should be all there is to it to supportxsd:choice
elements.Generated code for the example above (
Go
) would be something like:Additional context I've got a PR almost ready for this one.