mransan/ocaml-protoc

repeated enum decoder failing.

Opened this issue · 1 comments

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

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