Tuple value for blocks argument does not work for Web API calls #1258
Labels
bug
M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented
Version: 3x
web-client
Milestone
Both WebClient and AsyncWebClient accept a sequence of blocks (and attachments) but
_parse_web_class_objects
fails to serialize the objects into dictionaries since it only checks for lists viaisinstance(blocks, list)
, therefore disagreeing with the clients' signature.Impact on:
chat_postEphemeral
,chat_postMessage
,chat_scheduleMessage
,chat_unfurl
,chat_update
Block
andAttachment
Reproducible in:
The Slack SDK version
slack-sdk=3.18.1
Python runtime version
Python 3.10.3
OS info
Steps to reproduce:
Expected result:
Since both clients accept a
Sequence
, one should be able to pass both a list or a tuple.Actual result:
TypeError: Object of type SectionBlock is not JSON serializable
since the blocks weren't serialized into dicts.The text was updated successfully, but these errors were encountered: