-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Description
Describe the bug
When the same group is referenced twice with different values for minOccurs/maxOccurs, the second xsdGroup gets the minOccurs/maxOccurs values of the first reference.
A similar issue exists for two references to the same element.
Expected behavior
When there is more than one reference to the same group or element, each solved reference should have the correct minOccurs/maxOccurs values.
Library Version
1.2.19
Additional context
Example for element:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="myElement" type="xs:string" />
<xs:complexType name="complexType">
<xs:sequence>
<xs:element ref="myElement" minOccurs="1" maxOccurs="2"/>
<xs:element name="otherElement" type="xs:string"/>
<xs:element ref="myElement" minOccurs="3" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
I think the solution for this is to also compare minOccurs/maxOccurs values when comparing an unsolved element with a concrete element.
I made a pull request with this solution and unit tests showing the issue: #79
Metadata
Metadata
Assignees
Labels
No labels