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

choice tag is not fully handled properly #257

Closed
mikaelcom opened this issue Jul 13, 2021 · 1 comment
Closed

choice tag is not fully handled properly #257

mikaelcom opened this issue Jul 13, 2021 · 1 comment
Assignees
Labels

Comments

@mikaelcom
Copy link
Member

Describe the bug
If a choice tag is present with the attribute maxOccurs superior to 1, it should mark the child elements as array and not single item.

To Reproduce
Generate the package when having this choice tag:

<xs:complexType name='LigneFTTHType'>
 <xs:sequence>
  <xs:choice minOccurs='1' maxOccurs='2'>
    <xs:element maxOccurs='1' minOccurs='0' name='prise' nillable='false' type='ns1:PriseType'/>
    <xs:element maxOccurs='1' minOccurs='0' name='local' nillable='false' type='ns1:LocalType'/>
   </xs:choice>
  </xs:sequence>
</xs:complexType>

Expected behavior

/**
 * The prise
 * Meta information extracted from the WSDL
 * - choice: prise | local
 * - choiceMaxOccurs: 2
 * - choiceMinOccurs: 1
 * - maxOccurs: 1
 * - minOccurs: 0
 * - nillable: false
 * @var \ProviderService\Provider\Free\FTTH\StructType\PriseType[]
 */
 protected array $prise = [];
/**
 * The local
 * Meta information extracted from the WSDL
 * - choice: prise | local
 * - choiceMaxOccurs: 2
 * - choiceMinOccurs: 1
 * - maxOccurs: 1
 * - minOccurs: 0
 * - nillable: false
 * @var \ProviderService\Provider\Free\FTTH\StructType\LocalType[]
 */
 protected array $local = [];
@mikaelcom mikaelcom added the bug label Jul 13, 2021
@mikaelcom mikaelcom self-assigned this Jul 13, 2021
mikaelcom added a commit that referenced this issue Jul 13, 2021
mikaelcom added a commit that referenced this issue Jul 13, 2021
mikaelcom added a commit that referenced this issue Jul 13, 2021
mikaelcom added a commit that referenced this issue Jul 13, 2021
mikaelcom added a commit that referenced this issue Jul 13, 2021
mikaelcom added a commit that referenced this issue Jul 13, 2021
mikaelcom added a commit that referenced this issue Jul 13, 2021
mikaelcom added a commit that referenced this issue Jul 13, 2021
mikaelcom added a commit that referenced this issue Jul 13, 2021
mikaelcom added a commit that referenced this issue Jul 13, 2021
@mikaelcom
Copy link
Member Author

Only direct children properties should be marked as array. For instance, if the children are contained by a sequence tag, then the children should not be marked as array-typed properties

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

No branches or pull requests

1 participant