protobuf.js
protobuf.js copied to clipboard
Descriptor binaries does not match the binaries generated using `protoc`
protobuf.js version: 7.3.0
I would expect that binaries generated with protobufjs to match the ones generated using protoc
Based on the following .proto file
syntax = "proto3";
package reporting.consumption;
service ConsumptionApi {
rpc ListConsumption (ListConsumptionRequest) returns (ListConsumptionResponse) {}
}
enum IdentifierType {
SOME_VALUE = 0;
SOME_OTHER_VALUE = 1;
}
message Identifier {
IdentifierType type = 1;
}
message ListConsumptionResponse {
repeated Consumption consumption = 1;
}
message Consumption {
float consumption = 1;
}
message ListConsumptionRequest {
oneof consumption {
Identifier identifier = 1;
}
}
I get the following differences in the binaries:
| From `protbufjs` | From `protoc` |
|
|
We cannot easily get access to the .proto files where we need to generate client code, so having server side reflection from binaries generated by protobufjs is the ideal solution, except that it fails because protoc expects the binaries to look differently compared to what is returned by protobufjs