From 8a0a20294cb2cf20714df2dca3de810fca072e5f Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 29 Mar 2020 17:01:24 +0200 Subject: [PATCH] rename output fields to original name (not rename) --- http.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/http.go b/http.go index c131eb8..d078ea1 100644 --- a/http.go +++ b/http.go @@ -95,7 +95,12 @@ func (server httpServer) ServeHTTP(res http.ResponseWriter, req *http.Request) { response := api.EmptyResponse().WithError(apiErr) for key, value := range returned { - response.SetData(name, value) + // find original name from rename + for name, param := range service.Output { + if param.Rename == key { + response.SetData(name, value) + } + } } // 11. apply headers