We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The generated code when both stringEnums and removeEnumPrefix set to true sometimes conflicts.
For example, the generated code for the enum:
export enum Gender { UNSPECIFIED = "GENDER_UNSPECIFIED", MALE = "GENDER_MALE", FEMALE = "GENDER_FEMALE", OTHER = "GENDER_OTHER", }
However, somewhere in the generated code, they reference GENDER_UNSPECIFIED key that doesn't exist, instead of unprefixed one.
function createBaseChangeGenderRequest(): ChangeGenderRequest { return { gender: Gender.GENDER_UNSPECIFIED, other_gender: undefined }; } encode(message: ChangeGenderRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.gender !== Gender.GENDER_UNSPECIFIED) { writer.uint32(8).int32(genderToNumber(message.gender)); } if (message.other_gender !== undefined) { writer.uint32(18).string(message.other_gender); } return writer; },
The text was updated successfully, but these errors were encountered:
Ah shoot. Fwiw the PR that introduced removeEnumPrefix was this one:
removeEnumPrefix
https://github.com/stephenh/ts-proto/pull/779/files
And that "not default" check is from around in here:
ts-proto/src/main.ts
Line 1424 in 2639818
So notDefaultCheck should probably be using the remove-prefix-aware helper method from #779.
notDefaultCheck
If you'd like to work on at PR @cs-clarence , that'd be great! Thanks!
Sorry, something went wrong.
Fixed in #902 , thanks @buzap !
No branches or pull requests
The generated code when both stringEnums and removeEnumPrefix set to true sometimes conflicts.
For example, the generated code for the enum:
However, somewhere in the generated code, they reference GENDER_UNSPECIFIED key that doesn't exist, instead of unprefixed one.
The text was updated successfully, but these errors were encountered: