Skip to content

Commit eee195e

Browse files
Strongly discourage new usages of google/protobuf/type.proto and google/protobuf/api.proto as alternatives to descriptors
PiperOrigin-RevId: 784291978
1 parent 27c7c50 commit eee195e

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

src/google/protobuf/api.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ option go_package = "google.golang.org/protobuf/types/known/apipb";
5151
// sometimes simply referred to as "APIs" in other contexts, such as the name of
5252
// this message itself. See https://cloud.google.com/apis/design/glossary for
5353
// detailed terminology.
54+
//
55+
// New usages of this message as an alternative to ServiceDescriptorProto are
56+
// strongly discouraged. This message does not reliability preserve all
57+
// information necessary to model the schema and preserve semantics. Instead
58+
// make use of FileDescriptorSet which preserves the necessary information.
5459
message Api {
5560
// The fully qualified name of this interface, including package name
5661
// followed by the interface's simple name.
@@ -99,6 +104,11 @@ message Api {
99104
}
100105

101106
// Method represents a method of an API interface.
107+
//
108+
// New usages of this message as an alternative to MethodDescriptorProto are
109+
// strongly discouraged. This message does not reliability preserve all
110+
// information necessary to model the schema and preserve semantics. Instead
111+
// make use of FileDescriptorSet which preserves the necessary information.
102112
message Method {
103113
// The simple name of this method.
104114
string name = 1;

src/google/protobuf/type.proto

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
4444
option go_package = "google.golang.org/protobuf/types/known/typepb";
4545

4646
// A protocol buffer message type.
47+
//
48+
// New usages of this message as an alternative to DescriptorProto are strongly
49+
// discouraged. This message does not reliability preserve all information
50+
// necessary to model the schema and preserve semantics. Instead make use of
51+
// FileDescriptorSet which preserves the necessary information.
4752
message Type {
4853
// The fully qualified message name.
4954
string name = 1;
@@ -62,6 +67,11 @@ message Type {
6267
}
6368

6469
// A single field of a message type.
70+
//
71+
// New usages of this message as an alternative to FieldDescriptorProto are
72+
// strongly discouraged. This message does not reliability preserve all
73+
// information necessary to model the schema and preserve semantics. Instead
74+
// make use of FileDescriptorSet which preserves the necessary information.
6575
message Field {
6676
// Basic field types.
6777
enum Kind {
@@ -142,6 +152,11 @@ message Field {
142152
}
143153

144154
// Enum type definition.
155+
//
156+
// New usages of this message as an alternative to EnumDescriptorProto are
157+
// strongly discouraged. This message does not reliability preserve all
158+
// information necessary to model the schema and preserve semantics. Instead
159+
// make use of FileDescriptorSet which preserves the necessary information.
145160
message Enum {
146161
// Enum type name.
147162
string name = 1;
@@ -158,6 +173,11 @@ message Enum {
158173
}
159174

160175
// Enum value definition.
176+
//
177+
// New usages of this message as an alternative to EnumValueDescriptorProto are
178+
// strongly discouraged. This message does not reliability preserve all
179+
// information necessary to model the schema and preserve semantics. Instead
180+
// make use of FileDescriptorSet which preserves the necessary information.
161181
message EnumValue {
162182
// Enum value name.
163183
string name = 1;
@@ -169,6 +189,10 @@ message EnumValue {
169189

170190
// A protocol buffer option, which can be attached to a message, field,
171191
// enumeration, etc.
192+
//
193+
// New usages of this message as an alternative to FileOptions, MessageOptions,
194+
// FieldOptions, EnumOptions, EnumValueOptions, ServiceOptions, or MethodOptions
195+
// are strongly discouraged.
172196
message Option {
173197
// The option's name. For protobuf built-in options (options defined in
174198
// descriptor.proto), this is the short name. For example, `"map_entry"`.

0 commit comments

Comments
 (0)