Skip to content

Plugin should not generate List-properties if maxOccurs defaults to 1 #116

@ashauer

Description

@ashauer

For the simplify-plugin, all examples in the reference have choice-elements with maxOccurs="unbounded", which correctly results in List-properties. But if maxOccurs is not specified it defaults to 1, so there should not be List-properties but singular fields.

Example:

<xs:complexType name="typeWithElementsProperty">
  <xs:choice> <!-- maxOccurs defaults to 1! -->
    <xs:element name="foo" type="xs:string"/>
    <xs:element name="bar" type="xs:int"/>
  </xs:choice> 
</xs:complexType>

should rather result in

    @XmlElement(name = "foo", type = String.class)
    protected String foo;  // no List!
    @XmlElement(name = "bar", type = Integer.class)
    protected Integer bar;  // no List!

for usage of <simplify:as-element-property/>

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