hooklift / gowsdl

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

Type definitions stemming from simple types must not be pointer types #226

Closed w65536 closed 2 years ago

w65536 commented 2 years ago

Note that this pull request is based on top of #220 (first two commit) #222 (following three commits) because it also needs to modify what has been introduced in those PRs.

Simple types with "restriction base" and "list itemType" were defined with pointer types, if they did not resolve to basic Go types.

This example definitions:

<xs:simpleType name="MyType">
  <xs:restriction base="myBaseType"/>
</xs:simpleType>

<xs:simpleType name="myBaseType">
  <xs:restriction base="xs:int">
    <xs:totalDigits value="3"/>
  </xs:restriction>
</xs:simpleType>

must result in these generated types:

type MyType MyBaseType
type MyBaseType int32

Previously it generated:

type MyType *MyBaseType  // note the wrong pointer type here
type MyBaseType int32

which would generate this type of error: unknown type MyType