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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -