oneof.proto 589 B

1234567891011121314151617181920212223242526272829303132
  1. syntax = "proto2";
  2. import 'nanopb.proto';
  3. message SubMessage
  4. {
  5. repeated int32 array = 1 [(nanopb).max_count = 8];
  6. }
  7. /* Oneof in a message with other fields */
  8. message OneOfMessage
  9. {
  10. required int32 prefix = 1;
  11. oneof values
  12. {
  13. int32 first = 5;
  14. string second = 6 [(nanopb).max_size = 8];
  15. SubMessage third = 7;
  16. }
  17. required int32 suffix = 99;
  18. }
  19. /* Oneof in a message by itself */
  20. message PlainOneOfMessage
  21. {
  22. oneof values
  23. {
  24. int32 first = 5;
  25. string second = 6 [(nanopb).max_size = 8];
  26. SubMessage third = 7;
  27. }
  28. }