Protobuf-2.6.0 Required


#1

Using the latest Protobuf (2.6.0) causes the following errors: Muse_v2.proto:154:18: Message extensions cannot have required fields.
Muse_v2.proto:165:18: Message extensions cannot have required fields.
Muse_v2.proto:180:18: Message extensions cannot have required fields.
Muse_v2.proto:191:18: Message extensions cannot have required fields.
Muse_v2.proto:217:17: Message extensions cannot have required fields.
Muse_v2.proto:229:18: Message extensions cannot have required fields.
Muse_v2.proto:243:18: Message extensions cannot have required fields.
Muse_v2.proto:291:18: Message extensions cannot have required fields.

Also, Google makes the following recommendations:
"[B]Required Is Forever[/B][SIZE=14px] You should be very careful about marking fields as [/SIZE]required[SIZE=14px]. If at some point you wish to stop writing or sending a required field, it will be problematic to change the field to an optional field – old readers will consider messages without this field to be incomplete and may reject or drop them unintentionally. You should consider writing application-specific custom validation routines for your buffers instead. Some engineers at Google have come to the conclusion that using [/SIZE]required[SIZE=14px] does more harm than good; they prefer to use only [/SIZE]optional[SIZE=14px] and [/SIZE]repeated[SIZE=14px]. However, this view is not universal."[/SIZE]

I’m modifying the code to use “optional.”

I hope that this is okay?


#2

Thanks for letting us know, we have released an update that fixes this problem:

The fix was exactly as you describe, and also updated to make it compatible with proto3.