From a1b7b3aa3310e0b62934d5d0ae52c26af9516648 Mon Sep 17 00:00:00 2001 From: Alexis Guerville Date: Thu, 7 Apr 2022 21:29:03 +0200 Subject: [PATCH] Remove omitempty on WidgetStyle json tags Fixes a 400 on Updating a Widget --- reddit/widget.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reddit/widget.go b/reddit/widget.go index 0d48722..7c54eaf 100644 --- a/reddit/widget.go +++ b/reddit/widget.go @@ -109,7 +109,7 @@ func (l *WidgetList) UnmarshalJSON(data []byte) error { type widget struct { ID string `json:"id,omitempty"` Kind string `json:"kind,omitempty"` - Style *WidgetStyle `json:"styles,omitempty"` + Style *WidgetStyle `json:"styles"` } func (w *widget) kind() string { return w.Kind } @@ -258,8 +258,8 @@ type CustomWidget struct { // WidgetStyle contains style information for the widget. type WidgetStyle struct { - HeaderColor string `json:"headerColor,omitempty"` - BackgroundColor string `json:"backgroundColor,omitempty"` + HeaderColor string `json:"headerColor"` + BackgroundColor string `json:"backgroundColor"` } // WidgetImage is an image in a widget.