v0.0.511
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 3m10s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 3m10s
This commit is contained in:
parent
a1668b6e5a
commit
d7fbef37db
@ -7,10 +7,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type jsonHTTPResponse struct {
|
type jsonHTTPResponse struct {
|
||||||
statusCode int
|
statusCode int
|
||||||
data any
|
data any
|
||||||
headers []headerval
|
headers []headerval
|
||||||
cookies []cookieval
|
cookies []cookieval
|
||||||
|
filterOverride *string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (j jsonHTTPResponse) jsonRenderer(g *gin.Context) json.GoJsonRender {
|
func (j jsonHTTPResponse) jsonRenderer(g *gin.Context) json.GoJsonRender {
|
||||||
@ -18,6 +19,9 @@ func (j jsonHTTPResponse) jsonRenderer(g *gin.Context) json.GoJsonRender {
|
|||||||
if jsonfilter := g.GetString(jsonFilterKey); jsonfilter != "" {
|
if jsonfilter := g.GetString(jsonFilterKey); jsonfilter != "" {
|
||||||
f = &jsonfilter
|
f = &jsonfilter
|
||||||
}
|
}
|
||||||
|
if j.filterOverride != nil {
|
||||||
|
f = j.filterOverride
|
||||||
|
}
|
||||||
return json.GoJsonRender{Data: j.data, NilSafeSlices: true, NilSafeMaps: true, Filter: f}
|
return json.GoJsonRender{Data: j.data, NilSafeSlices: true, NilSafeMaps: true, Filter: f}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,3 +72,7 @@ func (j jsonHTTPResponse) Headers() []string {
|
|||||||
func JSON(sc int, data any) HTTPResponse {
|
func JSON(sc int, data any) HTTPResponse {
|
||||||
return &jsonHTTPResponse{statusCode: sc, data: data}
|
return &jsonHTTPResponse{statusCode: sc, data: data}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func JSONWithFilter(sc int, data any, f string) HTTPResponse {
|
||||||
|
return &jsonHTTPResponse{statusCode: sc, data: data, filterOverride: &f}
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package goext
|
package goext
|
||||||
|
|
||||||
const GoextVersion = "0.0.510"
|
const GoextVersion = "0.0.511"
|
||||||
|
|
||||||
const GoextVersionTimestamp = "2024-09-13T18:06:49+0200"
|
const GoextVersionTimestamp = "2024-09-15T18:22:07+0200"
|
||||||
|
Loading…
Reference in New Issue
Block a user