-
Notifications
You must be signed in to change notification settings - Fork 349
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
numerical enum first value not being picked up #643
Comments
I think the problem could be related to this encoding function, this is not allowing enums which are equal to 1, which obv incorrect. in the above example, when CURRENT=1 this is not being picked up. should this not be the following if (message.accountType !== -1) { |
Ah yeah, you are probably running into this: https://github.com/stephenh/ts-proto/blob/main/src/types.ts#L254 You could probably make If you'd like to submit a PR, that'd be great. Thanks! |
is there any update in here? |
in my case I dont want to this condition Also I dont have experience for this.
|
I did some hardcoding in type.ts file, but it's a workaround. I'm writing this for you to understand my needs. Replace the following line:
with:
Replace the following block:
with:
Based on my previous examples, is it possible to write an option for the toJSON function? I don't want it to exclude any default data from the returned JSON object. in the first example, if the type of the field is bool and its content is false, it doesn't appear in the JSON. |
hi, any enum which is equal to 1 is not being picked up. For example
export enum AccountType {
CURRENT = 1,
SAVING = 2,
JOINT = 3,
UNRECOGNIZED = -1,
}
in the above example CURRENT = 1 is not being picked up when we make the network call? What am i doing wrong, how can I remedy this.
The text was updated successfully, but these errors were encountered: