bin/x86_64-macos/google/protobuf/descriptor.proto in grpc-tools-1.58.3 vs bin/x86_64-macos/google/protobuf/descriptor.proto in grpc-tools-1.59.0
- old
+ new
@@ -144,29 +144,30 @@
// The fully-qualified type name of the extension field. Unlike
// Metadata.type, Declaration.type must have a leading dot for messages
// and enums.
optional string type = 3;
- // Deprecated. Please use "repeated".
- optional bool is_repeated = 4 [deprecated = true];
-
// If true, indicates that the number is reserved in the extension range,
// and any extension field with the number will fail to compile. Set this
// when a declared extension field is deleted.
optional bool reserved = 5;
// If true, indicates that the extension must be defined as repeated.
// Otherwise the extension must be defined as optional.
optional bool repeated = 6;
+
+ reserved 4; // removed is_repeated
}
- // go/protobuf-stripping-extension-declarations
- // Like Metadata, but we use a repeated field to hold all extension
- // declarations. This should avoid the size increases of transforming a large
- // extension range into small ranges in generated binaries.
+ // For external users: DO NOT USE. We are in the process of open sourcing
+ // extension declaration and executing internal cleanups before it can be
+ // used externally.
repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];
+ // Any features defined in the specific edition.
+ optional FeatureSet features = 50;
+
// The verification state of the extension range.
enum VerificationState {
// All the extensions of the range must be declared.
DECLARATION = 0;
UNVERIFIED = 1;
@@ -489,10 +490,13 @@
// Use this option to change the package of ruby generated classes. Default
// is empty. When this option is not set, the package name will be used for
// determining the ruby package.
optional string ruby_package = 45;
+ // Any features defined in the specific edition.
+ optional FeatureSet features = 50;
+
// The parser stores options it doesn't recognize here.
// See the documentation for the "Options" section above.
repeated UninterpretedOption uninterpreted_option = 999;
// Clients can define custom options in extensions of this message.
@@ -572,10 +576,13 @@
//
// TODO(b/261750190) This is legacy behavior we plan to remove once downstream
// teams have had time to migrate.
optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];
+ // Any features defined in the specific edition.
+ optional FeatureSet features = 12;
+
// 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;
@@ -709,23 +716,35 @@
TARGET_TYPE_ENUM_ENTRY = 7;
TARGET_TYPE_SERVICE = 8;
TARGET_TYPE_METHOD = 9;
}
- optional OptionTargetType target = 18 [deprecated = true];
repeated OptionTargetType targets = 19;
+ message EditionDefault {
+ optional string edition = 1;
+ optional string value = 2; // Textproto value.
+ }
+ repeated EditionDefault edition_defaults = 20;
+
+ // Any features defined in the specific edition.
+ optional FeatureSet features = 21;
+
// 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 4; // removed jtype
+ reserved 4; // removed jtype
+ reserved 18; // reserve target, target_obsolete_do_not_use
}
message OneofOptions {
+ // Any features defined in the specific edition.
+ optional FeatureSet features = 1;
+
// 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;
@@ -751,10 +770,13 @@
// well.
// TODO(b/261750190) Remove this legacy behavior once downstream teams have
// had time to migrate.
optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];
+ // Any features defined in the specific edition.
+ optional FeatureSet features = 7;
+
// 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;
@@ -765,19 +787,30 @@
// Depending on the target platform, this can emit Deprecated annotations
// for the enum value, or it will be completely ignored; in the very least,
// this is a formalization for deprecating enum values.
optional bool deprecated = 1 [default = false];
+ // Any features defined in the specific edition.
+ optional FeatureSet features = 2;
+
+ // Indicate that fields annotated with this enum value should not be printed
+ // out when using debug formats, e.g. when the field contains sensitive
+ // credentials.
+ optional bool debug_redact = 3 [default = false];
+
// 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;
}
message ServiceOptions {
+ // Any features defined in the specific edition.
+ optional FeatureSet features = 34;
+
// Note: Field numbers 1 through 32 are reserved for Google's internal RPC
// framework. We apologize for hoarding these numbers to ourselves, but
// we were already using them long before we decided to release Protocol
// Buffers.
@@ -816,10 +849,13 @@
IDEMPOTENT = 2; // idempotent, but may have side effects
}
optional IdempotencyLevel idempotency_level = 34
[default = IDEMPOTENCY_UNKNOWN];
+ // Any features defined in the specific edition.
+ optional FeatureSet features = 35;
+
// 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;
@@ -849,9 +885,102 @@
optional uint64 positive_int_value = 4;
optional int64 negative_int_value = 5;
optional double double_value = 6;
optional bytes string_value = 7;
optional string aggregate_value = 8;
+}
+
+// ===================================================================
+// Features
+
+// TODO(b/274655146) Enums in C++ gencode (and potentially other languages) are
+// not well scoped. This means that each of the feature enums below can clash
+// with each other. The short names we've chosen maximize call-site
+// readability, but leave us very open to this scenario. A future feature will
+// be designed and implemented to handle this, hopefully before we ever hit a
+// conflict here.
+message FeatureSet {
+ enum FieldPresence {
+ FIELD_PRESENCE_UNKNOWN = 0;
+ EXPLICIT = 1;
+ IMPLICIT = 2;
+ LEGACY_REQUIRED = 3;
+ }
+ optional FieldPresence field_presence = 1 [
+ retention = RETENTION_RUNTIME,
+ targets = TARGET_TYPE_FIELD,
+ targets = TARGET_TYPE_FILE,
+ edition_defaults = { edition: "2023", value: "EXPLICIT" }
+ ];
+
+ enum EnumType {
+ ENUM_TYPE_UNKNOWN = 0;
+ OPEN = 1;
+ CLOSED = 2;
+ }
+ optional EnumType enum_type = 2 [
+ retention = RETENTION_RUNTIME,
+ targets = TARGET_TYPE_ENUM,
+ targets = TARGET_TYPE_FILE,
+ edition_defaults = { edition: "2023", value: "OPEN" }
+ ];
+
+ enum RepeatedFieldEncoding {
+ REPEATED_FIELD_ENCODING_UNKNOWN = 0;
+ PACKED = 1;
+ EXPANDED = 2;
+ }
+ optional RepeatedFieldEncoding repeated_field_encoding = 3 [
+ retention = RETENTION_RUNTIME,
+ targets = TARGET_TYPE_FIELD,
+ targets = TARGET_TYPE_FILE,
+ edition_defaults = { edition: "2023", value: "PACKED" }
+ ];
+
+ enum StringFieldValidation {
+ STRING_FIELD_VALIDATION_UNKNOWN = 0;
+ MANDATORY = 1;
+ HINT = 2;
+ NONE = 3;
+ }
+ optional StringFieldValidation string_field_validation = 4 [
+ retention = RETENTION_RUNTIME,
+ targets = TARGET_TYPE_FIELD,
+ targets = TARGET_TYPE_FILE,
+ edition_defaults = { edition: "2023", value: "MANDATORY" }
+ ];
+
+ enum MessageEncoding {
+ MESSAGE_ENCODING_UNKNOWN = 0;
+ LENGTH_PREFIXED = 1;
+ DELIMITED = 2;
+ }
+ optional MessageEncoding message_encoding = 5 [
+ retention = RETENTION_RUNTIME,
+ targets = TARGET_TYPE_FIELD,
+ targets = TARGET_TYPE_FILE,
+ edition_defaults = { edition: "2023", value: "LENGTH_PREFIXED" }
+ ];
+
+ enum JsonFormat {
+ JSON_FORMAT_UNKNOWN = 0;
+ ALLOW = 1;
+ LEGACY_BEST_EFFORT = 2;
+ }
+ optional JsonFormat json_format = 6 [
+ retention = RETENTION_RUNTIME,
+ targets = TARGET_TYPE_MESSAGE,
+ targets = TARGET_TYPE_ENUM,
+ targets = TARGET_TYPE_FILE,
+ edition_defaults = { edition: "2023", value: "ALLOW" }
+ ];
+
+ optional FeatureSet raw_features = 999 [targets = TARGET_TYPE_UNKNOWN];
+
+ extensions 1000; // for Protobuf C++
+ extensions 1001; // for Protobuf Java
+
+ extensions 9995 to 9999; // For internal testing
}
// ===================================================================
// Optional source code info