Skip to content

Strongly discourage new usages of google/protobuf/type.proto and google/protobuf/api.proto as alternatives to descriptors #22631

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

Merged
merged 1 commit into from
Jul 17, 2025
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
10 changes: 10 additions & 0 deletions src/google/protobuf/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ option go_package = "google.golang.org/protobuf/types/known/apipb";
// sometimes simply referred to as "APIs" in other contexts, such as the name of
// this message itself. See https://cloud.google.com/apis/design/glossary for
// detailed terminology.
//
// New usages of this message as an alternative to ServiceDescriptorProto are
// strongly discouraged. This message does not reliability preserve all
// information necessary to model the schema and preserve semantics. Instead
// make use of FileDescriptorSet which preserves the necessary information.
message Api {
// The fully qualified name of this interface, including package name
// followed by the interface's simple name.
Expand Down Expand Up @@ -99,6 +104,11 @@ message Api {
}

// Method represents a method of an API interface.
//
// New usages of this message as an alternative to MethodDescriptorProto are
// strongly discouraged. This message does not reliability preserve all
// information necessary to model the schema and preserve semantics. Instead
// make use of FileDescriptorSet which preserves the necessary information.
message Method {
// The simple name of this method.
string name = 1;
Expand Down
24 changes: 24 additions & 0 deletions src/google/protobuf/type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
option go_package = "google.golang.org/protobuf/types/known/typepb";

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

// A single field of a message type.
//
// New usages of this message as an alternative to FieldDescriptorProto are
// strongly discouraged. This message does not reliability preserve all
// information necessary to model the schema and preserve semantics. Instead
// make use of FileDescriptorSet which preserves the necessary information.
message Field {
// Basic field types.
enum Kind {
Expand Down Expand Up @@ -142,6 +152,11 @@ message Field {
}

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

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

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