v0.0.277 DYN-166 json marshal filter in ginext Write
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 54s

This commit is contained in:
Timo Vetter 2023-10-05 12:00:51 +02:00
parent 05636a1e4d
commit 7c40bcfd3c
2 changed files with 7 additions and 3 deletions

View File

@ -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 {

View File

@ -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"