unittest_extras_full.proto 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. syntax = "proto2";
  2. package protobuf_unittest_extra;
  3. option csharp_namespace = "Google.ProtocolBuffers.TestProtos";
  4. option optimize_for = CODE_SIZE;
  5. option java_package = "com.google.protobuf";
  6. message TestInteropPerson {
  7. required string name = 1;
  8. required int32 id = 2;
  9. optional string email = 3;
  10. repeated int32 codes = 10 [packed=true];
  11. enum PhoneType {
  12. MOBILE = 0;
  13. HOME = 1;
  14. WORK = 2;
  15. }
  16. message PhoneNumber {
  17. required string number = 1;
  18. optional PhoneType type = 2 [default = HOME];
  19. }
  20. repeated PhoneNumber phone = 4;
  21. repeated group Addresses = 5 {
  22. required string address = 1;
  23. optional string address2 = 2;
  24. required string city = 3;
  25. required string state = 4;
  26. required fixed32 zip = 5;
  27. }
  28. extensions 100 to 199;
  29. }
  30. message TestInteropEmployeeId {
  31. required string number = 1;
  32. }
  33. extend TestInteropPerson {
  34. // Note: changed from required to optional, as required fields are not
  35. // permitted in extensions. (The fact that this was allowed in protogen
  36. // before was almost certainly a bug.)
  37. optional TestInteropEmployeeId employee_id = 126;
  38. }
  39. message TestMissingFieldsA {
  40. required string name = 1;
  41. required int32 id = 2;
  42. optional string email = 3;
  43. message SubA {
  44. required int32 count = 5;
  45. repeated string values = 6;
  46. }
  47. optional SubA testA = 11;
  48. }
  49. message TestMissingFieldsB {
  50. required string name = 1;
  51. required int32 id = 2;
  52. optional string website = 4;
  53. message SubB {
  54. repeated string values = 7;
  55. }
  56. optional SubB testB = 12;
  57. }