Thanks to visit codestin.com
Credit goes to github.com

Skip to content

simplify:as-element-property not respecting jaxb:globalBindings collectionType="indexed" #115

@jcrokicki

Description

@jcrokicki

I have a xsd using xs:choice and need each element exposed as a collection.

<xs:complexType name="AType">
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element type="XType" name="X"/>
<xs:element type="YType" name="Y"/>

It simplifies, but only as a List<>, not as an array as requested in the global bindings:

<jaxb:globalBindings localScoping="toplevel" collectionType="indexed">

I see that it realizes it should be simplified:
[INFO] Parsing input schema(s)...
[DEBUG] Element property [XAndY] has several types and will be simplified.
[INFO] Compiling input schema(s)...

The result is a class with
List getX(), List getY()
when it should be
XType[] getX(), YType[] getY()
because of the collectionType="indexed" in the globalBindings.

Am I not doing it correctly with simplify? Other classes without xs:choice are generating arrays properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions