Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update proto files on the 1.x branch #1600

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Protos/Conformance/google/protobuf/test_messages_proto2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ message TestAllTypesProto2 {
optional uint32 group_uint32 = 203;
}

optional group MultiWordGroupField = 204 {
optional int32 group_int32 = 205;
optional uint32 group_uint32 = 206;
}

// default values
optional int32 default_int32 = 241 [default = -123456789];
optional int64 default_int64 = 242 [default = -9123456789123456789];
Expand Down Expand Up @@ -250,6 +255,13 @@ extend TestAllTypesProto2 {
optional int32 extension_int32 = 120;
}

extend TestAllTypesProto2 {
optional group GroupField = 121 {
optional int32 group_int32 = 122;
optional uint32 group_uint32 = 123;
}
}

message UnknownToTestAllTypes {
optional int32 optional_int32 = 1001;
optional string optional_string = 1002;
Expand Down
2 changes: 2 additions & 0 deletions Protos/SwiftProtobuf/google/protobuf/descriptor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,8 @@ message FeatureSet {
extensions 1001; // for Protobuf Java
extensions 1002; // for Protobuf Go

extensions 9990; // for deprecated Java Proto1

extensions 9995 to 9999; // For internal testing
extensions 10000; // for https://github.com/bufbuild/protobuf-es
}
Expand Down
2 changes: 2 additions & 0 deletions Protos/upstream/google/protobuf/descriptor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,8 @@ message FeatureSet {
extensions 1001; // for Protobuf Java
extensions 1002; // for Protobuf Go

extensions 9990; // for deprecated Java Proto1

extensions 9995 to 9999; // For internal testing
extensions 10000; // for https://github.com/bufbuild/protobuf-es
}
Expand Down
12 changes: 12 additions & 0 deletions Protos/upstream/google/protobuf/test_messages_proto2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ message TestAllTypesProto2 {
optional uint32 group_uint32 = 203;
}

optional group MultiWordGroupField = 204 {
optional int32 group_int32 = 205;
optional uint32 group_uint32 = 206;
}

// default values
optional int32 default_int32 = 241 [default = -123456789];
optional int64 default_int64 = 242 [default = -9123456789123456789];
Expand Down Expand Up @@ -250,6 +255,13 @@ extend TestAllTypesProto2 {
optional int32 extension_int32 = 120;
}

extend TestAllTypesProto2 {
optional group GroupField = 121 {
optional int32 group_int32 = 122;
optional uint32 group_uint32 = 123;
}
}

message UnknownToTestAllTypes {
optional int32 optional_int32 = 1001;
optional string optional_string = 1002;
Expand Down
131 changes: 47 additions & 84 deletions Protos/upstream/google/protobuf/unittest_features.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,57 +26,76 @@ message TestMessage {
}
}

enum EnumFeature {
TEST_ENUM_FEATURE_UNKNOWN = 0;
VALUE1 = 1;
VALUE2 = 2;
VALUE3 = 3;
VALUE4 = 4;
VALUE5 = 5;
VALUE6 = 6;
VALUE7 = 7;
VALUE8 = 8;
VALUE9 = 9;
VALUE10 = 10;
VALUE11 = 11;
VALUE12 = 12;
VALUE13 = 13;
VALUE14 = 14;
VALUE15 = 15;
}

message TestFeatures {
optional int32 int_file_feature = 1 [
optional EnumFeature file_feature = 1 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FILE,
edition_defaults = { edition: EDITION_PROTO2, value: "-2" },
edition_defaults = { edition: EDITION_PROTO3, value: "-3" },
edition_defaults = { edition: EDITION_2023, value: "1" },
edition_defaults = { edition: EDITION_99997_TEST_ONLY, value: "2" },
edition_defaults = { edition: EDITION_99998_TEST_ONLY, value: "3" }
edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" },
edition_defaults = { edition: EDITION_PROTO3, value: "VALUE2" },
edition_defaults = { edition: EDITION_2023, value: "VALUE3" },
edition_defaults = { edition: EDITION_99997_TEST_ONLY, value: "VALUE4" },
edition_defaults = { edition: EDITION_99998_TEST_ONLY, value: "VALUE5" }
];
optional int32 int_extension_range_feature = 2 [
optional EnumFeature extension_range_feature = 2 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_EXTENSION_RANGE,
edition_defaults = { edition: EDITION_PROTO2, value: "1" }
edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" }
];
optional int32 int_message_feature = 3 [
optional EnumFeature message_feature = 3 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_MESSAGE,
edition_defaults = { edition: EDITION_PROTO2, value: "1" }
edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" }
];
optional int32 int_field_feature = 4 [
optional EnumFeature field_feature = 4 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
edition_defaults = { edition: EDITION_PROTO2, value: "1" }
edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" }
];
optional int32 int_oneof_feature = 5 [
optional EnumFeature oneof_feature = 5 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_ONEOF,
edition_defaults = { edition: EDITION_PROTO2, value: "1" }
edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" }
];
optional int32 int_enum_feature = 6 [
optional EnumFeature enum_feature = 6 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_ENUM,
edition_defaults = { edition: EDITION_PROTO2, value: "1" }
edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" }
];
optional int32 int_enum_entry_feature = 7 [
optional EnumFeature enum_entry_feature = 7 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_ENUM_ENTRY,
edition_defaults = { edition: EDITION_PROTO2, value: "1" }
edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" }
];
optional int32 int_service_feature = 8 [
optional EnumFeature service_feature = 8 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_SERVICE,
edition_defaults = { edition: EDITION_PROTO2, value: "1" }
edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" }
];
optional int32 int_method_feature = 9 [
optional EnumFeature method_feature = 9 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_METHOD,
edition_defaults = { edition: EDITION_PROTO2, value: "1" }
edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" }
];
optional int32 int_multiple_feature = 10 [
optional EnumFeature multiple_feature = 10 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FILE,
targets = TARGET_TYPE_FIELD,
Expand All @@ -87,7 +106,7 @@ message TestFeatures {
targets = TARGET_TYPE_METHOD,
targets = TARGET_TYPE_ONEOF,
targets = TARGET_TYPE_EXTENSION_RANGE,
edition_defaults = { edition: EDITION_PROTO2, value: "1" }
edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" }
];

optional bool bool_field_feature = 11 [
Expand All @@ -96,64 +115,8 @@ message TestFeatures {
edition_defaults = { edition: EDITION_PROTO2, value: "false" },
edition_defaults = { edition: EDITION_99997_TEST_ONLY, value: "true" }
];
optional float float_field_feature = 12 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
edition_defaults = { edition: EDITION_PROTO2, value: "1.1" },
edition_defaults = { edition: EDITION_99997_TEST_ONLY, value: "1.2" }
];

message MessageFeature {
optional bool bool_field = 1;
optional int32 int_field = 2;
optional float float_field = 3;
optional string string_field = 4;
}
optional MessageFeature message_field_feature = 13 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
edition_defaults = {
edition: EDITION_99997_TEST_ONLY,
value: "int_field: 2"
},
edition_defaults = {
edition: EDITION_99998_TEST_ONLY,
value: "string_field: '2024'"
},
edition_defaults = {
edition: EDITION_2023,
value: "bool_field: true int_field: 1 float_field: 1.5 string_field: '2023'"
},
edition_defaults = { edition: EDITION_PROTO2, value: "" }
];

enum EnumFeature {
TEST_ENUM_FEATURE_UNKNOWN = 0;
ENUM_VALUE1 = 1;
ENUM_VALUE2 = 2;
ENUM_VALUE3 = 3;
ENUM_VALUE4 = 4;
ENUM_VALUE5 = 5;
}
optional EnumFeature enum_field_feature = 14 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
edition_defaults = {
edition: EDITION_PROTO2,
value: "TEST_ENUM_FEATURE_UNKNOWN"
},
edition_defaults = { edition: EDITION_2023, value: "ENUM_VALUE1" },
edition_defaults = {
edition: EDITION_99997_TEST_ONLY,
value: "ENUM_VALUE2"
},
edition_defaults = {
edition: EDITION_99998_TEST_ONLY,
value: "ENUM_VALUE3"
}
];

optional int32 int_source_feature = 15 [
optional EnumFeature source_feature = 15 [
retention = RETENTION_SOURCE,
targets = TARGET_TYPE_FILE,
targets = TARGET_TYPE_FIELD,
Expand All @@ -164,10 +127,10 @@ message TestFeatures {
targets = TARGET_TYPE_METHOD,
targets = TARGET_TYPE_ONEOF,
targets = TARGET_TYPE_EXTENSION_RANGE,
edition_defaults = { edition: EDITION_PROTO2, value: "1" }
edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" }
];

optional string string_source_feature = 16 [
optional EnumFeature source_feature2 = 16 [
retention = RETENTION_SOURCE,
targets = TARGET_TYPE_FILE,
targets = TARGET_TYPE_FIELD,
Expand All @@ -178,6 +141,6 @@ message TestFeatures {
targets = TARGET_TYPE_METHOD,
targets = TARGET_TYPE_ONEOF,
targets = TARGET_TYPE_EXTENSION_RANGE,
edition_defaults = { edition: EDITION_PROTO2, value: "'2023'" }
edition_defaults = { edition: EDITION_PROTO2, value: "VALUE1" }
];
}
Loading
Loading