From 8d306db73030046ea55de5bf5352a3d6e27b8277 Mon Sep 17 00:00:00 2001 From: Miguel Martins Date: Mon, 28 May 2018 16:18:52 +0100 Subject: [PATCH] Add request/response type to method definition --- packages/grpc-protobufjs/src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/grpc-protobufjs/src/index.ts b/packages/grpc-protobufjs/src/index.ts index 5f443f983..25516792e 100644 --- a/packages/grpc-protobufjs/src/index.ts +++ b/packages/grpc-protobufjs/src/index.ts @@ -32,6 +32,8 @@ export interface MethodDefinition { path: string; requestStream: boolean; responseStream: boolean; + requestType: Protobuf.Type; + responseType: Protobuf.Type; requestSerialize: Serialize; responseSerialize: Serialize; requestDeserialize: Deserialize; @@ -92,6 +94,8 @@ function createMethodDefinition(method: Protobuf.Method, serviceName: string, op path: '/' + serviceName + '/' + method.name, requestStream: !!method.requestStream, responseStream: !!method.responseStream, + requestType: method.resolvedRequestType as Protobuf.Type, + responseType: method.resolvedResponseType as Protobuf.Type, requestSerialize: createSerializer(method.resolvedRequestType as Protobuf.Type), requestDeserialize: createDeserializer(method.resolvedRequestType as Protobuf.Type, options), responseSerialize: createSerializer(method.resolvedResponseType as Protobuf.Type),