Skip to content
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

Wrong annotation generation #12

Open
dimiii opened this issue Mar 24, 2016 · 0 comments
Open

Wrong annotation generation #12

dimiii opened this issue Mar 24, 2016 · 0 comments

Comments

@dimiii
Copy link

dimiii commented Mar 24, 2016

Hi. Seems like generator produces code with incorrect requirement on the presence of element.
For schema

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
           xmlns:xlink="http://www.w3.org/1999/xlink" 
           elementFormDefault="qualified" 
           attributeFormDefault="unqualified">

    <xs:group name="refgroup">
        <xs:sequence>
            <xs:element name="whatever" type="xs:string"/>
        </xs:sequence>
    </xs:group>

    <xs:element name="error">
        <xs:complexType>
            <xs:sequence>
                <xs:group ref="refgroup" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

next class is produced:

@Root(name = "error")
@Namespace(reference = "")
public class Error {

    @Element(name = "whatever", required = true)
    private String whatever;
  ....
}

I expect that due to constraint minOccurs="0" element whatever should get an annotation @Element(name = "whatever", required =false).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant