I need to store enumns inside a PB message that are defined outside the PB message definitions. Is it possible at all & how?
enum is one of the composite datatypes of Protobuf. It translates to an enum in the languages that we use, for example, Java. Now our message class contains an Enum for payment. Each of them also has a position which is what Protobuf uses while serialization and deserialization.
Protocol Buffers (Protobuf) is a free and open-source cross-platform data format used to serialize structured data. It is useful in developing programs to communicate with each other over a network or for storing data.
The proto-backwards-compatibility plugin is a Maven plugin to run a backwards compatibility check on a set of protobuf IDL files. The plugin can be integrated into various phases of a maven build to check that any changes to a set of . proto files are backwards compatible.
Protocol Buffer, a.k.a. Protobuf Protobuf is the most commonly used IDL (Interface Definition Language) for gRPC. It's where you basically store your data and function contracts in the form of a proto file.
It's possible. Look at this thread for more info. I like the suggestion to define enums in a seperate .proto file. like
enums.proto
enum A
{
FIRST = 1;
SECOND = 2;
}
enum B { ... }
other.proto
import "enums.proto";
message SOMEMESSAGE
{
required A myenum = 1;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With