entur/schema2proto

Incorrect enum naming with spaces and special characters

Closed this issue · 3 comments

Hi there,

Thanks so much for creating this tool! It looks like proto generation fails when theres an enumeration value that contains spaces and/or special characters.

Here's an example from an XSD I tried:
<xsd:enumeration value="Alternative Distribution System (ADS)"/>

It generated:
ENUM__BOOKING_CHANNEL__BASE_ALTERNATIVE _DISTRIBUTION _SYSTEM (_A_D_S) = 2;
which doesn't compile due to the spaces and parentheses.

seime commented

@agasparovic-sabre thanks for reporting, I've added a fix

Thanks so much! Would it be possible to publish a new schema2proto-lib package with the change? https://github.com/entur/schema2proto/packages/18841

seime commented

The latest SNAPSHOT is available on sonatype; it will be released to central eventually.

https://oss.sonatype.org/content/repositories/snapshots/no/entur/schema2proto-lib/1.0-alpha-14-SNAPSHOT/

The github repo could not handle snapshots in the beginning, so we stopped using it.