unittest_swift_fieldorder.proto 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Protos/unittest_swift_fieldorder.proto - test proto
  2. //
  3. // This source file is part of the Swift.org open source project
  4. //
  5. // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
  6. // Licensed under Apache License v2.0 with Runtime Library Exception
  7. //
  8. // See http://swift.org/LICENSE.txt for license information
  9. // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
  10. //
  11. // -----------------------------------------------------------------------------
  12. ///
  13. /// Check that fields get properly ordered when serializing
  14. ///
  15. // -----------------------------------------------------------------------------
  16. syntax = "proto2";
  17. package swift.protobuf;
  18. message TestFieldOrderings {
  19. optional string my_string = 11;
  20. extensions 2 to 8;
  21. optional int64 my_int = 1;
  22. extensions 12 to 55;
  23. optional float my_float = 101;
  24. message NestedMessage {
  25. optional int64 oo = 2;
  26. optional int32 bb = 1;
  27. }
  28. oneof options {
  29. int64 oneof_int64 = 60;
  30. bool oneof_bool = 9;
  31. string oneof_string = 150;
  32. int32 oneof_int32 = 10;
  33. }
  34. optional NestedMessage optional_nested_message = 200;
  35. }
  36. extend TestFieldOrderings {
  37. optional string my_extension_string = 50;
  38. optional int32 my_extension_int = 5;
  39. }