You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating a TextBlockObject with the Emoji field set to falsedoes not disable rendering of emojis in that text block.
The reason this happens is because of the omitempty JSON-tag:
typeTextBlockObjectstruct {
Typestring`json:"type"`Textstring`json:"text"`Emojibool`json:"emoji,omitempty"`// <-- this oneVerbatimbool`json:"verbatim,omitempty"`
}
This causes the field to be removed from the payload when encoded to JSON (if the field is false) as seen in this snippet: https://go.dev/play/p/63tqgJJ6Nnt.
The required JSON payload for creating a plain text object without support for emojis is:
This is likely an issue for some other fields with the omitempty tag as well, where you explicitly need to set a value to false in the JSON payload for the Slack API.
Expected behavior
Creating a TextBlockObject with the Emoji field set to falseshould disable rendering of emojis in that text block.
I can probably look at fixing this, since it's the same sort of change as #1341. Might also do a deep dive to see if there's any other omitempty fields that could be turned to pointers.
What happened
Creating a
TextBlockObject
with theEmoji
field set tofalse
does not disable rendering of emojis in that text block.The reason this happens is because of the
omitempty
JSON-tag:This causes the field to be removed from the payload when encoded to JSON (if the field is
false
) as seen in this snippet: https://go.dev/play/p/63tqgJJ6Nnt.The required JSON payload for creating a plain text object without support for emojis is:
This is likely an issue for some other fields with the
omitempty
tag as well, where you explicitly need to set a value tofalse
in the JSON payload for the Slack API.Expected behavior
Creating a
TextBlockObject
with theEmoji
field set tofalse
should disable rendering of emojis in that text block.Steps to reproduce
Versions
go version go1.23.1 linux/amd64
v0.14.0
The text was updated successfully, but these errors were encountered: