diff --git a/src/proto/grpc/reflection/v1alpha/reflection.proto b/src/proto/grpc/reflection/v1alpha/reflection.proto index 6e6a0b08644..32cea758236 100644 --- a/src/proto/grpc/reflection/v1alpha/reflection.proto +++ b/src/proto/grpc/reflection/v1alpha/reflection.proto @@ -36,12 +36,12 @@ package grpc.reflection.v1alpha; service ServerReflection { // The reflection service is structured as a bidirectional stream, ensuring // all related requests go to a single server. - rpc DescriptorDatabaseInfo(stream DescriptorDatabaseRequest) - returns (stream DescriptorDatabaseResponse); + rpc ServerReflectionInfo(stream ServerReflectionRequest) + returns (stream ServerReflectionResponse); } -// The message sent by the client when calling DescriptorDatabaseInfo method. -message DescriptorDatabaseRequest { +// The message sent by the client when calling ServerReflectionInfo method. +message ServerReflectionRequest { string host = 1; // To use reflection service, the client should set one of the following // fields in message_request. The server distinguishes requests by their @@ -83,18 +83,18 @@ message ExtensionRequest { int32 extension_number = 2; } -// The message sent by the server to answer DescriptorDatabaseInfo method. -message DescriptorDatabaseResponse { +// The message sent by the server to answer ServerReflectionInfo method. +message ServerReflectionResponse { string valid_host = 1; - DescriptorDatabaseRequest original_request = 2; + ServerReflectionRequest original_request = 2; // The server set one of the following fields accroding to the message_request // in the request. oneof message_response { - // A serialized FileDescriptorProto message. We avoid taking a dependency on - // descriptor.proto, which uses proto2 only features, by making them opaque - // bytes instead. This message is used to answer file_by_filename, - // file_containing_symbol, file_containing_extension requests. - bytes file_descriptor_proto = 4; + // This message is used to answer file_by_filename, file_containing_symbol, + // file_containing_extension requests with transitive dependencies. As + // the repeated label is not allowed in oneof fields, we use a + // FileDescriptorResponse message to encapsulate the repeated fields. + FileDescriptorResponse file_descriptor_response = 4; // This message is used to answer all_extension_numbers_of_type requst. ExtensionNumberResponse all_extension_numbers_response = 5; @@ -107,6 +107,16 @@ message DescriptorDatabaseResponse { } } +// Serialized FileDescriptorProto messages sent by the server answering +// a file_by_filename, file_containing_symbol, or file_containing_extension +// request. +message FileDescriptorResponse { + // Serialized FileDescriptorProto messages. We avoid taking a dependency on + // descriptor.proto, which uses proto2 only features, by making them opaque + // bytes instead. + repeated bytes file_descriptor_proto = 1; +} + // A list of extension numbers sent by the server answering // all_extension_numbers_of_type request. message ExtensionNumberResponse { @@ -116,11 +126,19 @@ message ExtensionNumberResponse { repeated int32 extension_number = 2; } -// A list of service names sent by the server answering list_services request. +// A list of ServiceResponse sent by the server answering list_services request. message ListServiceResponse { - // Full names of registered services, including package names. The format + // The information of each service may be expanded in the future, so we use + // ServiceResponse message to encapsulate it. + repeated ServiceResponse service = 1; +} + +// The information of a single service used by ListServiceResponse to answer +// list_services request. +message ServiceResponse { + // Full name of a registered service, including its package name. The format // is . - repeated string service = 1; + string name = 1; } // The error code and error message sent by the server when an error occurs.