Skip to content

Commit

Permalink
Merge pull request #788 from prgres/attachment-text-field-json-tag#784
Browse files Browse the repository at this point in the history
Resolve: Revert changes to json tags in Attachment's Text field
  • Loading branch information
kanata2 authored Dec 7, 2020
2 parents ca71d93 + 7550a26 commit 56302e0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion attachments.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ type Attachment struct {
Title string `json:"title,omitempty"`
TitleLink string `json:"title_link,omitempty"`
Pretext string `json:"pretext,omitempty"`
Text string `json:"text"` // Required
Text string `json:"text,omitempty"`

ImageURL string `json:"image_url,omitempty"`
ThumbURL string `json:"thumb_url,omitempty"`
Expand Down
1 change: 0 additions & 1 deletion attachments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ func TestAttachment_UnmarshalMarshalJSON_WithBlocks(t *testing.T) {

originalAttachmentJson := `{
"id": 1,
"text":"",
"blocks": [
{
"type": "section",
Expand Down
2 changes: 1 addition & 1 deletion chat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func TestPostMessage(t *testing.T) {
}),
},
expected: url.Values{
"attachments": []string{`[{"text":"","blocks":` + blockStr + `}]`},
"attachments": []string{`[{"blocks":` + blockStr + `}]`},
"channel": []string{"CXXX"},
"token": []string{"testing-token"},
},
Expand Down

0 comments on commit 56302e0

Please sign in to comment.