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

repeated enum decoder failing. #159

Open
ttamttam opened this issue Jun 10, 2021 · 1 comment
Open

repeated enum decoder failing. #159

ttamttam opened this issue Jun 10, 2021 · 1 comment

Comments

@ttamttam
Copy link

I had something like that:

enum MyEnum { FIRST = 0; SECOND = 1}
message Informations {
  repeated MyEnum i = 1;
}

But when decoding such values, it failed in decode_informations, because it reached an

 | Some (1, pk) ->

branch. (Expecting Bytes, instead of Varint).

I had to bypass this problem with an indirection:

enum MyEnum { FIRST = 0; SECOND = 1}
message Information { MyEnum information = 1}
message Informations { repeated Information informations = 1}

Best regards

@ttamttam
Copy link
Author

Considering this: protocolbuffers/protobuf-javascript#63, it may well be a good solution to do nothing. :-)

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

No branches or pull requests

1 participant