hooklift / gowsdl

WSDL2Go code generation as well as its SOAP proxy
Mozilla Public License 2.0
1.14k stars 390 forks source link

Support local simple types inside elements #220

Closed w65536 closed 2 years ago

w65536 commented 2 years ago

For instance, this XSD definition:

<xs:element name="myType">
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:minLength value="1"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

shall result in this generated type definition:

type myType string

The implementation approach is identical to the already existing support for local complex types. It basically copies the "SimpleType" template into the element processing when no Type is defined for the element.

A simple test with an enumeration has also been implemented