[protobuf] Repeated combined with Required

2013-10-08 Thread Dror Cohen
Hi, if I have a field that is required to show at least 1 time but can occur a few times - What's the expected decleration in the proto file? I can think of the following options: 1. Just using repeated isn't good enough - it has to appear at least once. 2. Use first option and force a check in

Re: [protobuf] Repeated combined with Required

2013-10-08 Thread Ilia Mirkin
Protobuf is about serializing and deserializing data, not enforcing restrictions on it. (required being the odd case there, and it is often recommended that you avoid it.) Using repeated in the spec, and then enforcing any additional restrictions in your code is the preferred way to go. That way,