how to define repeated field as required in Google protocol buffer?I have a field that modifier is repeated(repeated int32 A ).How i add required modifier to this field? in fact i want to have both modifier(required and repeated).
Sorry, there is no way to mark a repeated field as "required".
In fact, required
itself is widely considered a misfeature and is being phased out in Protobuf 3.0. For an extended explanation/rant of why this is the case, see:
https://capnproto.org/faq.html#how-do-i-make-a-field-required-like-in-protocol-buffers
(That's a link to the Cap'n Proto web site, which is a competitor to Protobufs, but its author (namely, me) was also the main author of Protobuf v2.)
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