// I also tried stripping the payload= prefix.
let deserializer = Config::new(10, false);
deserializer.deserialize_str::<BlockActions>(&raw_string).expect("must succeed");
The error:
thread 'api::slack::block_actions::tests::read_block_response' panicked at src/api/slack.rs:560:73:
must succeed: Error("missing field `team`")
I have the following structs to represent a URL-encoded value, produced by converting a JSON into URL-encoded on urldecoder.org.
The text here (all values replaced with samples):
The error:
Meanwhile, the equivalent JSON succeeds:
{"type":"block_actions","user":{"id":"U1234567890","username":"john_doe","name":"john_doe","team_id":"T1234567890"},"api_app_id":"A1234567890","token":"abcdef1234567890abcdef1234567890","container":{"type":"message","message_ts":"123456789.123456","channel_id":"C1234567890","is_ephemeral":false,"thread_ts":"123456789.654321"},"trigger_id":"1234567890.0987654321.abcdef1234567890abcdef1234567890","team":{"id":"T1234567890","domain":"example-domain"},"enterprise":null,"is_enterprise_install":false,"channel":{"id":"C1234567890","name":"example-channel"},"message":{"user":"U0987654321","type":"message","ts":"123456789.123456","bot_id":"B1234567890","app_id":"A1234567890","text":"This+is+an+example+text,+replacing+the+original+text+with+something+new.","team":"T1234567890","thread_ts":"123456789.654321","parent_user_id":"U1234567890","blocks":[{"type":"section","block_id":"exampleBlockId1","text":{"type":"mrkdwn","text":"This+is+an+example+section.","verbatim":false}},{"type":"actions","block_id":"exampleBlockId2","elements":[{"type":"button","action_id":"exampleActionId1","text":{"type":"plain_text","text":":computer:+example-button-1","emoji":true},"url":"https:\/\/example.com\/example-path-1"},{"type":"button","action_id":"exampleActionId2","text":{"type":"plain_text","text":":ticket:+example-ticket-1","emoji":true},"url":"https:\/\/example.com\/example-path-2"},{"type":"button","action_id":"exampleActionId3","text":{"type":"plain_text","text":":page_facing_up:++example-button-2","emoji":true},"url":"https:\/\/example.com\/example-path-3"},{"type":"button","action_id":"exampleActionId4","text":{"type":"plain_text","text":":ticket:+example-ticket-2","emoji":true},"url":"https:\/\/example.com\/example-path-4"},{"type":"button","action_id":"exampleActionId5","text":{"type":"plain_text","text":":ticket:+example-ticket-3","emoji":true},"url":"https:\/\/example.com\/example-path-5"}]},{"type":"divider","block_id":"exampleDividerId"},{"type":"actions","block_id":"exampleBlockId3","elements":[{"type":"button","action_id":"exampleActionId6","text":{"type":"plain_text","text":":thumbsup:","emoji":true},"value":"thumbs_up"},{"type":"button","action_id":"exampleActionId7","text":{"type":"plain_text","text":":thumbsdown:","emoji":true},"value":"thumbs_down"}]}]},"state":{"values":{}},"response_url":"https:\/\/hooks.slack.com\/actions\/T1234567890\/1234567890123\/abcdef1234567890abcdef1234567890","actions":[{"action_id":"exampleActionId6","block_id":"exampleBlockId3","text":{"type":"plain_text","text":":thumbsup:","emoji":true},"value":"thumbs_up","type":"button","action_ts":"1234567890"}]}