Skip to content

Fix broken min/max calculations on groupRef child elements#91

Merged
goetas merged 2 commits into
goetas-webservices:masterfrom
veewee:group-ref-invalid-min-max
Sep 9, 2025
Merged

Fix broken min/max calculations on groupRef child elements#91
goetas merged 2 commits into
goetas-webservices:masterfrom
veewee:group-ref-invalid-min-max

Conversation

@veewee
Copy link
Copy Markdown
Contributor

@veewee veewee commented Sep 8, 2025

For reference:

This improves min/max occurence calculations on groupRef elements:

   <complexType name="nullableGroupRef">
        <sequence>
            <group minOccurs="0" ref="tns:mygroup"/>
        </sequence>
    </complexType>
    <complexType name="listGroupRef">
        <sequence>
            <group minOccurs="0" maxOccurs="unbounded" ref="tns:mygroup"/>
        </sequence>
    </complexType>
    <complexType name="scopedGroupRef">
        <sequence>
            <group minOccurs="2" maxOccurs="6" ref="tns:mygroup"/>
        </sequence>
    </complexType>
    <complexType name="singleGroupRef">
        <sequence>
            <group minOccurs="1" maxOccurs="1" ref="tns:mygroup"/>
        </sequence>
    </complexType>
    <group name="mygroup">
        <sequence>
            <element name="nullable" type="string" minOccurs="0" />
            <element name="list" type="string" minOccurs="0" maxOccurs="unbounded" />
            <element name="scoped" type="string" minOccurs="3" maxOccurs="5" />
            <element name="single" type="string" minOccurs="1" maxOccurs="1"/>
        </sequence>
    </group>

Resulting in following min/maxes on the child elements:

Types:
  > http://test-uri/:nullableGroupRef {
    ?string $nullable
    array<int<0, max>, string> $list
    array<int<0, 5>, string> $scoped
    ?string $single
  }
  > http://test-uri/:listGroupRef {
    array<int<0, max>, string> $nullable
    array<int<0, max>, string> $list
    array<int<0, max>, string> $scoped
    array<int<0, max>, string> $single
  }
  > http://test-uri/:scopedGroupRef {
    array<int<0, 6>, string> $nullable
    array<int<0, max>, string> $list
    array<int<6, 30>, string> $scoped
    array<int<2, 6>, string> $single
  }
  > http://test-uri/:singleGroupRef {
    ?string $nullable
    array<int<0, max>, string> $list
    array<int<3, 5>, string> $scoped
    string $single
  }

@veewee veewee force-pushed the group-ref-invalid-min-max branch from 6c0b4a5 to 59850e8 Compare September 8, 2025 18:45
@goetas
Copy link
Copy Markdown
Member

goetas commented Sep 9, 2025

Nice! Thank you for the contribution!

@goetas goetas merged commit ac6341c into goetas-webservices:master Sep 9, 2025
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

Successfully merging this pull request may close these issues.

2 participants