Chat postMessage argument error only if both attachments and text are missing#11
Chat postMessage argument error only if both attachments and text are missing#11rorhug wants to merge 1 commit intoslack-ruby:masterfrom
Conversation
|
This file is generated by a rake task and will be overwritten next time Slack updates their web API. So we need a solution that fixes this during generation. |
|
I think the problem is that https://github.com/slackhq/slack-api-docs/blob/master/methods/chat.postMessage.json says that |
|
Ah I see, thanks for the explanation, I'll do that now. |
|
I am open for a way to fix this here with a work-around. Generally slack API docs are not complete or often miss things. Maybe we can have a patches folder that applies diffs to the generated files or something like that? I suspect it will take a long time for Slack to figure out how to express "one of these two parameters is required" in JSON :) |
|
All true. I'll open the issue anyway and hopefully get around building some kind of a system like what you described. |
|
Already opened https://github.com/dblock/slack-ruby-client/issues/12 ;) |
|
Thanks! I'll open one their api-docs too though |
|
@RoryDH Slack said they will not be updating that repo until they hire someone. We don't have to wait. I've pulled JSON files from https://github.com/slackhq/slack-api-docs into https://github.com/dblock/slack-api-ref, which I intend to maintain and kept JSON files only. Could you please help with this issue? Maybe we can update the JSON schema to support "one of these parameters is required" and fix slack-ruby-client? |
|
I've opened a ticket with Slack on fixing the documentation, https://artsy.slack.com/help/requests/610828. |
|
Implemented as patches in dblock@84416a9. |
The slack chat http api allows you to send no text field if you do provide attachments. This change will stop the local validation from blocking that use case.