Empty strings in enums results in broken code
bensijons opened this issue · 1 comments
bensijons commented
If a WSDL file has an enumeration with an empty string value, gowsdl will currently generate broken go code.
For example:
<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>
This XML will generate the following go code:
Since the enum value is being used as part of the name of the const generated, the empty string value will return a const name that is the same as the name of the type generated (In this case DriveTrain)
c4milo commented
Good catch @bensijons! Thanks!