Skip to content

Commit

Permalink
Update protos from upstream (#1739)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasvl authored Jan 2, 2025
1 parent 43bc712 commit f554d76
Show file tree
Hide file tree
Showing 25 changed files with 162,136 additions and 96 deletions.
44 changes: 44 additions & 0 deletions Protos/SwiftProtobuf/google/protobuf/descriptor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ option optimize_for = SPEED;
// files it parses.
message FileDescriptorSet {
repeated FileDescriptorProto file = 1;

// Extensions for tooling.
extensions 536000000 [declaration = {
number: 536000000
type: ".buf.descriptor.v1.FileDescriptorSetExtension"
full_name: ".buf.descriptor.v1.buf_file_descriptor_set_extension"
}];
}

// The full set of known editions.
Expand Down Expand Up @@ -124,9 +131,15 @@ message FileDescriptorProto {
// The supported values are "proto2", "proto3", and "editions".
//
// If `edition` is present, this value must be "editions".
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional string syntax = 12;

// The edition of the proto file.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional Edition edition = 14;
}

Expand Down Expand Up @@ -539,6 +552,9 @@ message FileOptions {
optional string ruby_package = 45;

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 50;

// The parser stores options it doesn't recognize here.
Expand Down Expand Up @@ -625,6 +641,9 @@ message MessageOptions {
optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 12;

// The parser stores options it doesn't recognize here. See above.
Expand Down Expand Up @@ -765,6 +784,9 @@ message FieldOptions {
repeated EditionDefault edition_defaults = 20;

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 21;

// Information about the support window of a feature.
Expand Down Expand Up @@ -801,6 +823,9 @@ message FieldOptions {

message OneofOptions {
// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 1;

// The parser stores options it doesn't recognize here. See above.
Expand Down Expand Up @@ -833,6 +858,9 @@ message EnumOptions {
optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 7;

// The parser stores options it doesn't recognize here. See above.
Expand All @@ -850,6 +878,9 @@ message EnumValueOptions {
optional bool deprecated = 1 [default = false];

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 2;

// Indicate that fields annotated with this enum value should not be printed
Expand All @@ -870,6 +901,9 @@ message EnumValueOptions {
message ServiceOptions {

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 34;

// Note: Field numbers 1 through 32 are reserved for Google's internal RPC
Expand Down Expand Up @@ -915,6 +949,9 @@ message MethodOptions {
[default = IDEMPOTENCY_UNKNOWN];

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 35;

// The parser stores options it doesn't recognize here. See above.
Expand Down Expand Up @@ -1252,6 +1289,13 @@ message SourceCodeInfo {
optional string trailing_comments = 4;
repeated string leading_detached_comments = 6;
}

// Extensions for tooling.
extensions 536000000 [declaration = {
number: 536000000
type: ".buf.descriptor.v1.SourceCodeInfoExtension"
full_name: ".buf.descriptor.v1.buf_source_code_info_extension"
}];
}

// Describes the relationship between generated code and its original source
Expand Down
42 changes: 38 additions & 4 deletions Protos/SwiftProtobuf/google/protobuf/wrappers.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,17 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Wrappers for primitive (non-message) types. These types are useful
// for embedding primitives in the `google.protobuf.Any` type and for places
// where we need to distinguish between the absence of a primitive
// typed field and its default value.
// Wrappers for primitive (non-message) types. These types were needed
// for legacy reasons and are not recommended for use in new APIs.
//
// Historically these wrappers were useful to have presence on proto3 primitive
// fields, but proto3 syntax has been updated to support the `optional` keyword.
// Using that keyword is now the strongly preferred way to add presence to
// proto3 primitive fields.
//
// A secondary usecase was to embed primitives in the `google.protobuf.Any`
// type: it is now recommended that you embed your value in your own wrapper
// message which can be specifically documented.
//
// These wrappers have no meaningful use within repeated fields as they lack
// the ability to detect presence on individual elements.
Expand All @@ -53,6 +60,9 @@ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
// Wrapper message for `double`.
//
// The JSON representation for `DoubleValue` is JSON number.
//
// Not recommended for use in new APIs, but still useful for legacy APIs and
// has no plan to be removed.
message DoubleValue {
// The double value.
double value = 1;
Expand All @@ -61,6 +71,9 @@ message DoubleValue {
// Wrapper message for `float`.
//
// The JSON representation for `FloatValue` is JSON number.
//
// Not recommended for use in new APIs, but still useful for legacy APIs and
// has no plan to be removed.
message FloatValue {
// The float value.
float value = 1;
Expand All @@ -69,6 +82,9 @@ message FloatValue {
// Wrapper message for `int64`.
//
// The JSON representation for `Int64Value` is JSON string.
//
// Not recommended for use in new APIs, but still useful for legacy APIs and
// has no plan to be removed.
message Int64Value {
// The int64 value.
int64 value = 1;
Expand All @@ -77,6 +93,9 @@ message Int64Value {
// Wrapper message for `uint64`.
//
// The JSON representation for `UInt64Value` is JSON string.
//
// Not recommended for use in new APIs, but still useful for legacy APIs and
// has no plan to be removed.
message UInt64Value {
// The uint64 value.
uint64 value = 1;
Expand All @@ -85,6 +104,9 @@ message UInt64Value {
// Wrapper message for `int32`.
//
// The JSON representation for `Int32Value` is JSON number.
//
// Not recommended for use in new APIs, but still useful for legacy APIs and
// has no plan to be removed.
message Int32Value {
// The int32 value.
int32 value = 1;
Expand All @@ -93,6 +115,9 @@ message Int32Value {
// Wrapper message for `uint32`.
//
// The JSON representation for `UInt32Value` is JSON number.
//
// Not recommended for use in new APIs, but still useful for legacy APIs and
// has no plan to be removed.
message UInt32Value {
// The uint32 value.
uint32 value = 1;
Expand All @@ -101,6 +126,9 @@ message UInt32Value {
// Wrapper message for `bool`.
//
// The JSON representation for `BoolValue` is JSON `true` and `false`.
//
// Not recommended for use in new APIs, but still useful for legacy APIs and
// has no plan to be removed.
message BoolValue {
// The bool value.
bool value = 1;
Expand All @@ -109,6 +137,9 @@ message BoolValue {
// Wrapper message for `string`.
//
// The JSON representation for `StringValue` is JSON string.
//
// Not recommended for use in new APIs, but still useful for legacy APIs and
// has no plan to be removed.
message StringValue {
// The string value.
string value = 1;
Expand All @@ -117,6 +148,9 @@ message StringValue {
// Wrapper message for `bytes`.
//
// The JSON representation for `BytesValue` is JSON string.
//
// Not recommended for use in new APIs, but still useful for legacy APIs and
// has no plan to be removed.
message BytesValue {
// The bytes value.
bytes value = 1;
Expand Down
44 changes: 44 additions & 0 deletions Protos/upstream/google/protobuf/descriptor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ option optimize_for = SPEED;
// files it parses.
message FileDescriptorSet {
repeated FileDescriptorProto file = 1;

// Extensions for tooling.
extensions 536000000 [declaration = {
number: 536000000
type: ".buf.descriptor.v1.FileDescriptorSetExtension"
full_name: ".buf.descriptor.v1.buf_file_descriptor_set_extension"
}];
}

// The full set of known editions.
Expand Down Expand Up @@ -124,9 +131,15 @@ message FileDescriptorProto {
// The supported values are "proto2", "proto3", and "editions".
//
// If `edition` is present, this value must be "editions".
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional string syntax = 12;

// The edition of the proto file.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional Edition edition = 14;
}

Expand Down Expand Up @@ -539,6 +552,9 @@ message FileOptions {
optional string ruby_package = 45;

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 50;

// The parser stores options it doesn't recognize here.
Expand Down Expand Up @@ -625,6 +641,9 @@ message MessageOptions {
optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 12;

// The parser stores options it doesn't recognize here. See above.
Expand Down Expand Up @@ -765,6 +784,9 @@ message FieldOptions {
repeated EditionDefault edition_defaults = 20;

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 21;

// Information about the support window of a feature.
Expand Down Expand Up @@ -801,6 +823,9 @@ message FieldOptions {

message OneofOptions {
// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 1;

// The parser stores options it doesn't recognize here. See above.
Expand Down Expand Up @@ -833,6 +858,9 @@ message EnumOptions {
optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 7;

// The parser stores options it doesn't recognize here. See above.
Expand All @@ -850,6 +878,9 @@ message EnumValueOptions {
optional bool deprecated = 1 [default = false];

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 2;

// Indicate that fields annotated with this enum value should not be printed
Expand All @@ -870,6 +901,9 @@ message EnumValueOptions {
message ServiceOptions {

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 34;

// Note: Field numbers 1 through 32 are reserved for Google's internal RPC
Expand Down Expand Up @@ -915,6 +949,9 @@ message MethodOptions {
[default = IDEMPOTENCY_UNKNOWN];

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 35;

// The parser stores options it doesn't recognize here. See above.
Expand Down Expand Up @@ -1252,6 +1289,13 @@ message SourceCodeInfo {
optional string trailing_comments = 4;
repeated string leading_detached_comments = 6;
}

// Extensions for tooling.
extensions 536000000 [declaration = {
number: 536000000
type: ".buf.descriptor.v1.SourceCodeInfoExtension"
full_name: ".buf.descriptor.v1.buf_source_code_info_extension"
}];
}

// Describes the relationship between generated code and its original source
Expand Down
8 changes: 8 additions & 0 deletions Protos/upstream/google/protobuf/edition_unittest.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,14 @@ message TestMessageSize {
int64 m6 = 6;
}

// Tests eager verification of a lazy message field.
message TestEagerlyVerifiedLazyMessage {
message LazyMessage {
bytes bytes_field = 1;
}
LazyMessage lazy_message = 1 [lazy = true];
}

// Test that RPC services work.
message FooRequest {}
message FooResponse {}
Expand Down
13 changes: 13 additions & 0 deletions Protos/upstream/google/protobuf/late_loaded_option.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
edition = "2023";

package protobuf_unittest;

import "google/protobuf/descriptor.proto";

message LateLoadedOption {
int32 value = 1;

extend google.protobuf.MessageOptions {
LateLoadedOption ext = 95126892;
}
}
Loading

0 comments on commit f554d76

Please sign in to comment.