Skip to content

Commit

Permalink
Remove omitempty on WidgetStyle json tags
Browse files Browse the repository at this point in the history
Fixes a 400 on Updating a Widget
  • Loading branch information
Sadzeih committed Apr 7, 2022
1 parent bb9bc5a commit a1b7b3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions reddit/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit a1b7b3a

Please sign in to comment.