diff --git a/google/protobuf/api.proto b/google/protobuf/api.proto index bbbe9833071b8..7c30e8b7ad3c5 100644 --- a/google/protobuf/api.proto +++ b/google/protobuf/api.proto @@ -40,6 +40,7 @@ option java_package = "com.google.protobuf"; option java_outer_classname = "ApiProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/genproto/protobuf/api;api"; // Api is a light-weight descriptor for a protocol buffer service. message Api { diff --git a/google/protobuf/descriptor.proto b/google/protobuf/descriptor.proto index 558ae23eb48de..d9b9064b057cb 100644 --- a/google/protobuf/descriptor.proto +++ b/google/protobuf/descriptor.proto @@ -157,7 +157,6 @@ message FieldDescriptorProto { LABEL_OPTIONAL = 1; LABEL_REQUIRED = 2; LABEL_REPEATED = 3; - // TODO(sanjay): Should we add LABEL_MAP? }; optional string name = 1; @@ -431,13 +430,14 @@ message MessageOptions { // parser. optional bool map_entry = 7; + reserved 8; // javalite_serializable + + // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; // Clients can define custom options in extensions of this message. See above. extensions 1000 to max; - - reserved 8; // javalite_serializable } message FieldOptions { @@ -551,6 +551,7 @@ message EnumOptions { // is a formalization for deprecating enums. optional bool deprecated = 3 [default=false]; + // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; @@ -605,6 +606,17 @@ message MethodOptions { // this is a formalization for deprecating methods. optional bool deprecated = 33 [default=false]; + // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + // or neither? HTTP based RPC implementation may choose GET verb for safe + // methods, and PUT verb for idempotent methods instead of the default POST. + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0; + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects + } + optional IdempotencyLevel idempotency_level = + 34 [default=IDEMPOTENCY_UNKNOWN]; + // The parser stores options it doesn't recognize here. See above. repeated UninterpretedOption uninterpreted_option = 999; diff --git a/google/protobuf/field_mask.proto b/google/protobuf/field_mask.proto index b6d32a792185f..c68d247c8a478 100644 --- a/google/protobuf/field_mask.proto +++ b/google/protobuf/field_mask.proto @@ -37,6 +37,7 @@ option java_package = "com.google.protobuf"; option java_outer_classname = "FieldMaskProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/genproto/protobuf/field_mask;field_mask"; // `FieldMask` represents a set of symbolic field paths, for example: // diff --git a/google/protobuf/map_proto2_unittest.proto b/google/protobuf/map_proto2_unittest.proto index ddc2a58247bc2..e9360a5a68706 100644 --- a/google/protobuf/map_proto2_unittest.proto +++ b/google/protobuf/map_proto2_unittest.proto @@ -29,7 +29,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto2"; - +option cc_enable_arenas = true; import "google/protobuf/unittest_import.proto"; diff --git a/google/protobuf/source_context.proto b/google/protobuf/source_context.proto index 79137ce8e172b..f3b2c966811f3 100644 --- a/google/protobuf/source_context.proto +++ b/google/protobuf/source_context.proto @@ -37,6 +37,7 @@ option java_package = "com.google.protobuf"; option java_outer_classname = "SourceContextProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/genproto/protobuf/source_context;source_context"; // `SourceContext` represents information about the source of a // protobuf element, like the file in which it is defined. diff --git a/google/protobuf/type.proto b/google/protobuf/type.proto index 504cd25db3496..c1e696d6fc0d0 100644 --- a/google/protobuf/type.proto +++ b/google/protobuf/type.proto @@ -41,6 +41,7 @@ option java_package = "com.google.protobuf"; option java_outer_classname = "TypeProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/genproto/protobuf/ptype;ptype"; // A protocol buffer message type. message Type { diff --git a/google/protobuf/unittest.proto b/google/protobuf/unittest.proto index cc2f4b34a003f..96289cc55bdad 100644 --- a/google/protobuf/unittest.proto +++ b/google/protobuf/unittest.proto @@ -886,3 +886,34 @@ message TestJsonName { optional int32 FIELD_NAME5 = 5; optional int32 field_name6 = 6 [json_name = "@type"]; } + +message TestHugeFieldNumbers { + optional int32 optional_int32 = 536870000; + optional int32 fixed_32 = 536870001; + repeated int32 repeated_int32 = 536870002 [packed = false]; + repeated int32 packed_int32 = 536870003 [packed = true]; + + optional ForeignEnum optional_enum = 536870004; + optional string optional_string = 536870005; + optional bytes optional_bytes = 536870006; + optional ForeignMessage optional_message = 536870007; + + optional group OptionalGroup = 536870008 { + optional int32 group_a = 536870009; + } + + map string_string_map = 536870010; + + oneof oneof_field { + uint32 oneof_uint32 = 536870011; + TestAllTypes oneof_test_all_types = 536870012; + string oneof_string = 536870013; + bytes oneof_bytes = 536870014; + } + + extensions 536860000 to 536869999; +} + +extend TestHugeFieldNumbers { + optional TestAllTypes test_all_types = 536860000; +} diff --git a/google/protobuf/unittest_lite.proto b/google/protobuf/unittest_lite.proto index 878ec7c1d2081..c39ac6b01f472 100644 --- a/google/protobuf/unittest_lite.proto +++ b/google/protobuf/unittest_lite.proto @@ -163,6 +163,9 @@ message TestAllTypesLite { bytes oneof_bytes = 114; NestedMessage oneof_lazy_nested_message = 115 [lazy = true]; } + + // Tests toString for non-repeated fields with a list suffix + optional int32 deceptively_named_list = 116; } message ForeignMessageLite { @@ -405,3 +408,34 @@ message V2MessageLite { required int32 int_field = 1; optional V2EnumLite enum_field = 2 [ default = V2_FIRST ]; } + +message TestHugeFieldNumbersLite { + optional int32 optional_int32 = 536870000; + optional int32 fixed_32 = 536870001; + repeated int32 repeated_int32 = 536870002 [packed = false]; + repeated int32 packed_int32 = 536870003 [packed = true]; + + optional ForeignEnumLite optional_enum = 536870004; + optional string optional_string = 536870005; + optional bytes optional_bytes = 536870006; + optional ForeignMessageLite optional_message = 536870007; + + optional group OptionalGroup = 536870008 { + optional int32 group_a = 536870009; + } + + map string_string_map = 536870010; + + oneof oneof_field { + uint32 oneof_uint32 = 536870011; + TestAllTypesLite oneof_test_all_types = 536870012; + string oneof_string = 536870013; + bytes oneof_bytes = 536870014; + } + + extensions 536860000 to 536869999; +} + +extend TestHugeFieldNumbersLite { + optional TestAllTypesLite test_all_types_lite = 536860000; +}