0

I have a (proto2) .proto file with a definition akin to the following:

message foo {
  string myString = 1 [(nanopb).max_size = 20];
}

How can I find the max length of "myString" in python? To get the value of an enum, I can do something like myProto.myCoolEnum.Value(), but I haven't found anything analogous for getting max size for a string.

Maxthecat
  • 1,250
  • 17
  • 37
  • I think this might answer your question: https://stackoverflow.com/questions/32836315/python-protocol-buffer-field-options – jpa Nov 20 '21 at 06:32
  • That's exactly what I was looking for. Thanks! – Maxthecat Nov 22 '21 at 17:42
  • Does this answer your question? [Python Protocol Buffer field options](https://stackoverflow.com/questions/32836315/python-protocol-buffer-field-options) – jpa Nov 22 '21 at 18:04

0 Answers0