diff --git a/server/extractor.go b/server/extractor.go index 52ce0056..5cbddd77 100644 --- a/server/extractor.go +++ b/server/extractor.go @@ -95,14 +95,20 @@ func extractEndpoint(method reflect.Method) *registry.Endpoint { request := extractValue(reqType, 0) response := extractValue(rspType, 0) - return ®istry.Endpoint{ + ep := ®istry.Endpoint{ Name: method.Name, Request: request, Response: response, - Metadata: map[string]string{ - "stream": fmt.Sprintf("%v", stream), - }, } + + // set endpoint metadata for stream + if stream { + ep.Metadata = map[string]string{ + "stream": fmt.Sprintf("%v", stream), + } + } + + return ep } func extractSubValue(typ reflect.Type) *registry.Value { diff --git a/server/grpc/extractor.go b/server/grpc/extractor.go index 753cc175..8b3ed4f6 100644 --- a/server/grpc/extractor.go +++ b/server/grpc/extractor.go @@ -90,14 +90,19 @@ func extractEndpoint(method reflect.Method) *registry.Endpoint { request := extractValue(reqType, 0) response := extractValue(rspType, 0) - return ®istry.Endpoint{ + ep := ®istry.Endpoint{ Name: method.Name, Request: request, Response: response, - Metadata: map[string]string{ - "stream": fmt.Sprintf("%v", stream), - }, } + + if stream { + ep.Metadata = map[string]string{ + "stream": fmt.Sprintf("%v", stream), + } + } + + return ep } func extractSubValue(typ reflect.Type) *registry.Value {