fix(alerting): Prevent empty keyValue from being marshalled

This commit is contained in:
TwiN
2022-11-10 17:51:24 -05:00
parent f1711b5c0b
commit b801cc5801
2 changed files with 5 additions and 5 deletions

View File

@ -84,7 +84,7 @@ type Sections struct {
}
type Widgets struct {
KeyValue KeyValue `json:"keyValue,omitempty"`
KeyValue *KeyValue `json:"keyValue,omitempty"`
Buttons []Buttons `json:"buttons,omitempty"`
}
@ -144,7 +144,7 @@ func (provider *AlertProvider) buildRequestBody(endpoint *core.Endpoint, alert *
{
Widgets: []Widgets{
{
KeyValue: KeyValue{
KeyValue: &KeyValue{
TopLabel: endpoint.DisplayName(),
Content: message,
ContentMultiline: "true",
@ -153,7 +153,7 @@ func (provider *AlertProvider) buildRequestBody(endpoint *core.Endpoint, alert *
},
},
{
KeyValue: KeyValue{
KeyValue: &KeyValue{
TopLabel: "Condition results",
Content: results,
ContentMultiline: "true",