willemdj / erlsom

XML parser for Erlang
GNU Lesser General Public License v3.0
264 stars 103 forks source link

Fix 2x-nested translation of record list fields #94

Closed danielfinke closed 2 months ago

danielfinke commented 2 months ago

Fixes bet365/soap#47

When using soap:erlang2wsdl on the referenced .hrl, a crash occurs as described in the above issue. This is because the nesting of the translated hobbies field is doubled up; the return value from erlsom_type2xsd:translateType/2 has the MinOccurs/MaxOccurs wrapper applied twice for lists.

Ignore the list element type's MinOccurs/MaxOccurs and use the 0 and unbounded values, for lists, respectively. This will produce the same result as shown on https://github.com/bet365/soap/blob/6848d29d9d123c37f22b309f19de848f6309b66a/doc/generating_a_wsdl.md?plain=1#L160.

Source .hrl