Skip to content
New issue

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

fix(OneOf): Fix oneof "NOT_SET" type incorrectly stripping underscores #53

Merged
merged 1 commit into from
Jan 16, 2020

Conversation

zakhenry
Copy link
Contributor

@zakhenry zakhenry commented Jan 15, 2020

Currently, if you have a oneof field that is labelled with an underscore in the type, the output typescript enum "NOT_SET" field strips the casing. This PR fixes that issue.

Proto:

    oneof two_words {
        bool a_2 = 3;
        bool b_2 = 4;
    }

Before:

    export enum TwoWordsCase {
        TWOWORDS_NOT_SET = 0,
    
    A_2 = 3,

    B_2 = 4,

    }

After:

    export enum TwoWordsCase {
        TWO_WORDS_NOT_SET = 0,
    
    A_2 = 3,

    B_2 = 4,

    }

Note the change is just a one liner, the huge diff is from adding a oneof to the example code.

@agreatfool agreatfool merged commit 06ca29f into agreatfool:master Jan 16, 2020
@agreatfool
Copy link
Owner

Thank you for the great work. Just merged & new version 2.5.10 has been released.

@zakhenry zakhenry deleted the fix/oneof-casing branch January 16, 2020 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants