bin/x86_64-macos/google/protobuf/descriptor.proto in grpc-tools-1.65.2 vs bin/x86_64-macos/google/protobuf/descriptor.proto in grpc-tools-1.66.0.pre3
- old
+ new
@@ -60,10 +60,14 @@
// The full set of known editions.
enum Edition {
// A placeholder for an unknown edition value.
EDITION_UNKNOWN = 0;
+ // A placeholder edition for specifying default behaviors *before* a feature
+ // was first introduced. This is effectively an "infinite past".
+ EDITION_LEGACY = 900;
+
// Legacy syntax "editions". These pre-date editions, but behave much like
// distinct editions. These can't be used to specify the edition of proto
// files, but feature definitions must supply proto2/proto3 defaults for
// backwards compatibility.
EDITION_PROTO2 = 998;
@@ -446,16 +450,20 @@
optional bool java_multiple_files = 10 [default = false];
// This option does nothing.
optional bool java_generate_equals_and_hash = 20 [deprecated=true];
- // If set true, then the Java2 code generator will generate code that
- // throws an exception whenever an attempt is made to assign a non-UTF-8
- // byte sequence to a string field.
- // Message reflection will do the same.
- // However, an extension field still accepts non-UTF-8 byte sequences.
- // This option has no effect on when used with the lite runtime.
+ // A proto2 file can set this to true to opt in to UTF-8 checking for Java,
+ // which will throw an exception if invalid UTF-8 is parsed from the wire or
+ // assigned to a string field.
+ //
+ // TODO: clarify exactly what kinds of field types this option
+ // applies to, and update these docs accordingly.
+ //
+ // Proto3 files already perform these checks. Setting the option explicitly to
+ // false has no effect: it cannot be used to opt proto3 files out of UTF-8
+ // checks.
optional bool java_string_check_utf8 = 27 [default = false];
// Generated classes can be optimized for speed or code size.
enum OptimizeMode {
SPEED = 1; // Generate complete code for parsing, serialization,
@@ -484,10 +492,11 @@
// explicitly set them to true.
optional bool cc_generic_services = 16 [default = false];
optional bool java_generic_services = 17 [default = false];
optional bool py_generic_services = 18 [default = false];
reserved 42; // removed php_generic_services
+ reserved "php_generic_services";
// Is this file deprecated?
// Depending on the target platform, this can emit Deprecated annotations
// for everything in the file, or it will be completely ignored; in the very
// least, this is a formalization for deprecating files.
@@ -758,10 +767,32 @@
repeated EditionDefault edition_defaults = 20;
// Any features defined in the specific edition.
optional FeatureSet features = 21;
+ // Information about the support window of a feature.
+ message FeatureSupport {
+ // The edition that this feature was first available in. In editions
+ // earlier than this one, the default assigned to EDITION_LEGACY will be
+ // used, and proto files will not be able to override it.
+ optional Edition edition_introduced = 1;
+
+ // The edition this feature becomes deprecated in. Using this after this
+ // edition may trigger warnings.
+ optional Edition edition_deprecated = 2;
+
+ // The deprecation warning text if this feature is used after the edition it
+ // was marked deprecated in.
+ optional string deprecation_warning = 3;
+
+ // The edition this feature is no longer available in. In editions after
+ // this one, the last default assigned will be used, and proto files will
+ // not be able to override it.
+ optional Edition edition_removed = 4;
+ }
+ optional FeatureSupport feature_support = 22;
+
// 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;
@@ -826,10 +857,13 @@
// 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];
+ // Information about the support window of a feature value.
+ optional FieldOptions.FeatureSupport feature_support = 4;
+
// 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;
@@ -938,10 +972,14 @@
}
optional FieldPresence field_presence = 1 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
+ // TODO Enable this in google3 once protoc rolls out.
+ feature_support = {
+ edition_introduced: EDITION_2023,
+ },
edition_defaults = { edition: EDITION_PROTO2, value: "EXPLICIT" },
edition_defaults = { edition: EDITION_PROTO3, value: "IMPLICIT" },
edition_defaults = { edition: EDITION_2023, value: "EXPLICIT" }
];
@@ -952,10 +990,14 @@
}
optional EnumType enum_type = 2 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_ENUM,
targets = TARGET_TYPE_FILE,
+ // TODO Enable this in google3 once protoc rolls out.
+ feature_support = {
+ edition_introduced: EDITION_2023,
+ },
edition_defaults = { edition: EDITION_PROTO2, value: "CLOSED" },
edition_defaults = { edition: EDITION_PROTO3, value: "OPEN" }
];
enum RepeatedFieldEncoding {
@@ -965,23 +1007,32 @@
}
optional RepeatedFieldEncoding repeated_field_encoding = 3 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
+ // TODO Enable this in google3 once protoc rolls out.
+ feature_support = {
+ edition_introduced: EDITION_2023,
+ },
edition_defaults = { edition: EDITION_PROTO2, value: "EXPANDED" },
edition_defaults = { edition: EDITION_PROTO3, value: "PACKED" }
];
enum Utf8Validation {
UTF8_VALIDATION_UNKNOWN = 0;
VERIFY = 2;
NONE = 3;
+ reserved 1;
}
optional Utf8Validation utf8_validation = 4 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
+ // TODO Enable this in google3 once protoc rolls out.
+ feature_support = {
+ edition_introduced: EDITION_2023,
+ },
edition_defaults = { edition: EDITION_PROTO2, value: "NONE" },
edition_defaults = { edition: EDITION_PROTO3, value: "VERIFY" }
];
enum MessageEncoding {
@@ -991,10 +1042,14 @@
}
optional MessageEncoding message_encoding = 5 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE,
+ // TODO Enable this in google3 once protoc rolls out.
+ feature_support = {
+ edition_introduced: EDITION_2023,
+ },
edition_defaults = { edition: EDITION_PROTO2, value: "LENGTH_PREFIXED" }
];
enum JsonFormat {
JSON_FORMAT_UNKNOWN = 0;
@@ -1004,19 +1059,38 @@
optional JsonFormat json_format = 6 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_MESSAGE,
targets = TARGET_TYPE_ENUM,
targets = TARGET_TYPE_FILE,
+ // TODO Enable this in google3 once protoc rolls out.
+ feature_support = {
+ edition_introduced: EDITION_2023,
+ },
edition_defaults = { edition: EDITION_PROTO2, value: "LEGACY_BEST_EFFORT" },
edition_defaults = { edition: EDITION_PROTO3, value: "ALLOW" }
];
reserved 999;
- extensions 1000; // for Protobuf C++
- extensions 1001; // for Protobuf Java
- extensions 1002; // for Protobuf Go
+ extensions 1000 to 9994 [
+ declaration = {
+ number: 1000,
+ full_name: ".pb.cpp",
+ type: ".pb.CppFeatures"
+ },
+ declaration = {
+ number: 1001,
+ full_name: ".pb.java",
+ type: ".pb.JavaFeatures"
+ },
+ declaration = { number: 1002, full_name: ".pb.go", type: ".pb.GoFeatures" },
+ declaration = {
+ number: 9990,
+ full_name: ".pb.proto1",
+ type: ".pb.Proto1Features"
+ }
+ ];
extensions 9995 to 9999; // For internal testing
extensions 10000; // for https://github.com/bufbuild/protobuf-es
}
@@ -1029,10 +1103,18 @@
// defaults. Not all editions may be contained here. For a given edition,
// the defaults at the closest matching edition ordered at or before it should
// be used. This field must be in strict ascending order by edition.
message FeatureSetEditionDefault {
optional Edition edition = 3;
- optional FeatureSet features = 2;
+
+ // Defaults of features that can be overridden in this edition.
+ optional FeatureSet overridable_features = 4;
+
+ // Defaults of features that can't be overridden in this edition.
+ optional FeatureSet fixed_features = 5;
+
+ reserved 1, 2;
+ reserved "features";
}
repeated FeatureSetEditionDefault defaults = 1;
// The minimum supported edition (inclusive) when this was constructed.
// Editions before this will not have defaults.