c++ - how to define repeated field as required in google protocol buffer? -
how define repeated field required in google protocol buffer?i have field modifier repeated(repeated int32 ).how add required modifier field? in fact want have both modifier(required , repeated).
sorry, there no way mark repeated field "required".
in fact, required
considered misfeature , being phased out in protobuf 3.0. extended explanation/rant of why case, see:
https://capnproto.org/faq.html#how-do-i-make-a-field-required-like-in-protocol-buffers
(that's link cap'n proto web site, competitor protobufs, author (namely, me) main author of protobuf v2.)
Comments
Post a Comment