Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JiBX 1.2.1
-
Fix Version/s: JiBX 1.2.3
-
Component/s: CodeGen
-
Labels:None
-
Number of attachments :
Description
codegen is generating binding xml with <collection> element having no usage=optional even when the minOccurs is set to zero (maxOccurs=unbounded)
XSD Snippet:
<xsd:complexType name="ABC">
<xsd:sequence>
<xsd:element type="test:xxT" name="xx"
minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
binding Xml:
<collection get-method="getXxs" set-method="setXxs">
<structure map-as="ns2:xxT" name="xx"/>
</collection>
Thanks,
Arnab
Activity
Dennis Sosnoski
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Dennis Sosnoski [ dsosnoski ] |
Dennis Sosnoski
made changes -
| Resolution | Not A Bug [ 6 ] | |
| Status | Open [ 1 ] | Closed [ 6 ] |
Arnabkanti
made changes -
| Status | Closed [ 6 ] | Reopened [ 4 ] |
| Resolution | Not A Bug [ 6 ] |
Dennis Sosnoski
made changes -
| Status | Reopened [ 4 ] | Resolved [ 5 ] |
| Fix Version/s | JiBX 1.2.3 [ 16349 ] | |
| Resolution | Fixed [ 1 ] |
Although this may be counterintuitive, it's by design. <collection> binding components always represent the equivalent of minOccurs="0" maxOccurs="unbounded". The only reason you'd need usage="optional" on a <collection> element of the binding is if there were a wrapper element name associated with the collection, and that wrapper element were itself optional - corresponding to this type of schema structure:
<xs:element name="wrapper">
<xs:complexType>
<xs:complexContent>
<xs:sequence>
<xs:element name="value" type="xs:string"/>
</xs:sequence>
</xs:complexContent>
</xs:complexType>
</xs:element>