Skip to content

Commit

Permalink
fix: added omitempty on children type on struct block
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafasegf authored and jomei committed Aug 9, 2021
1 parent cb95dc1 commit 8aab81a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions block.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ type ParagraphBlock struct {
HasChildren bool `json:"has_children,omitempty"`
Paragraph struct {
Text Paragraph `json:"text"`
Children []Block `json:"children"`
Children []Block `json:"children,omitempty"`
} `json:"paragraph"`
}

Expand Down Expand Up @@ -161,7 +161,7 @@ type BulletedListItemBlock struct {
HasChildren bool `json:"has_children,omitempty"`
BulletedListItem struct {
Text Paragraph `json:"text"`
Children []Block `json:"children"`
Children []Block `json:"children,omitempty"`
} `json:"bulleted_list_item"`
}

Expand All @@ -178,7 +178,7 @@ type NumberedListItemBlock struct {
HasChildren bool `json:"has_children,omitempty"`
NumberedListItem struct {
Text Paragraph `json:"text"`
Children []Block `json:"children"`
Children []Block `json:"children,omitempty"`
} `json:"numbered_list_item"`
}

Expand All @@ -195,7 +195,7 @@ type ToDoBlock struct {
HasChildren bool `json:"has_children"`
ToDo struct {
Text Paragraph `json:"text"`
Children []Block `json:"children"`
Children []Block `json:"children,omitempty"`
Checked bool `json:"checked"`
} `json:"to_do"`
}
Expand All @@ -212,10 +212,10 @@ type ToggleBlock struct {
LastEditedTime *time.Time `json:"last_edited_time,omitempty"`
HasChildren bool `json:"has_children,omitempty"`
Text Paragraph `json:"text"`
Children []Block `json:"children"`
Children []Block `json:"children,omitempty"`
Toggle struct {
Text Paragraph `json:"text"`
Children []Block `json:"children"`
Children []Block `json:"children,omitempty"`
} `json:"toggle"`
}

Expand Down

0 comments on commit 8aab81a

Please sign in to comment.