hooklift / gowsdl

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

Handle empty strings in enums #237

Closed bensijons closed 2 years ago

bensijons commented 2 years ago

This PR fixes #236

In short, this XML:

<simpleType name="DriveTrain">
    <restriction base="string">
        <enumeration value="" />
        <enumeration value="Front Wheel Drive" />
        <enumeration value="Rear Wheel Drive" />
        <enumeration value="All Wheel Drive" />
        <enumeration value="Four Wheel Drive" />
    </restriction>
</simpleType>

Will generate the following broken go code:

Screenshot 2022-03-15 at 21 33 26

This PR changes the implementation so it is generated like so:

Screenshot 2022-03-15 at 21 33 47