fix(alerting): Prevent empty keyValue from being marshalled

This commit is contained in:
TwiN committed 2022-11-10 22:12:20 -05:00
1 parent f1711b5c0b
commit b801cc5801
2 files changed
+5 -5

No files matched your search

+3 -3
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",