I am making changes to my python code that is using protobuf 3
I read that
- string, bytes, and message fields, optional is compatible with repeated
- changing a field between a map<K, V> and the corresponding repeated message field is binary compatible
Given required and optional is now removed from protobuf 3, I don't need to define optional for it anymore, I am wondering can I change and remove the repeated field type to a single object type and stay backward compatible? Not entirely sure if the field is automatically assume it is optional or not. If not what are my options here?
I made the code changes, and everything seems to be passing in unit tests, and I am unable to find much documentation on this, thanks for the help.
message Class {
bool is_restricted = 1;
repeated Student students = 2;
}
To
message Class {
bool is_restricted = 1;
Student student = 2;
}
Does this works and backward compatible?