From f867969aa372cdb2ae97eaa180979d5cd5cd4927 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Sat, 9 Nov 2019 10:32:52 +0000 Subject: [PATCH] Don't set stream unless its true --- extractor.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/extractor.go b/extractor.go index 753cc17..8b3ed4f 100644 --- a/extractor.go +++ b/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 {