acg/lwpb — Issue #4: optionally enforce required fields when encoding and decoding
Author: acg
Created: 2011-11-25 19:32:58+00:00
State: open

The lwpb C library doesn't enforce required fields when encoding and decoding. This is [by design](http://code.google.com/p/lwpb/#Limitations). It would require another recursive pass over all the fields in the message descriptor to see if any were omitted in the encoded message. It would also require tracking which fields have been seen and which haven't, which is a departure from the callback design of lwpb_decoder_decode, where caller is responsible for actually populating the decoded message.

Since validation of required missing fields is a questionable (see [Required is Forever](http://code.google.com/apis/protocolbuffers/docs/proto.html#simple)) and less frequently used feature of protobuf, and since enforcing them imposes a penalty in decoding, this should be an optional feature of the python decoder that you must explicitly request.