From 7c40bcfd3cb13157de987d980d57f91ac7184dea Mon Sep 17 00:00:00 2001 From: Timo Vetter Date: Thu, 5 Oct 2023 12:00:51 +0200 Subject: [PATCH] v0.0.277 DYN-166 json marshal filter in ginext Write --- ginext/response.go | 6 +++++- goextVersion.go | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ginext/response.go b/ginext/response.go index eafe6e4..e8f9c47 100644 --- a/ginext/response.go +++ b/ginext/response.go @@ -27,7 +27,11 @@ func (j jsonHTTPResponse) Write(g *gin.Context) { for _, v := range j.headers { g.Header(v.Key, v.Val) } - g.Render(j.statusCode, json.GoJsonRender{Data: j.data, NilSafeSlices: true, NilSafeMaps: true}) + var f *string + if jsonfilter := g.GetString("goext.jsonfilter"); jsonfilter != "" { + f = &jsonfilter + } + g.Render(j.statusCode, json.GoJsonRender{Data: j.data, NilSafeSlices: true, NilSafeMaps: true, Filter: f}) } func (j jsonHTTPResponse) WithHeader(k string, v string) HTTPResponse { diff --git a/goextVersion.go b/goextVersion.go index 1d8a1cb..10bbe65 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.276" +const GoextVersion = "0.0.277" -const GoextVersionTimestamp = "2023-10-05T10:59:20+0200" +const GoextVersionTimestamp = "2023-10-05T12:00:51+0200"