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
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 54s
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user