Skip to content

Mark text/markdown_text arg_group as not required in chat methods#84

Merged
dblock merged 1 commit into
slack-ruby:masterfrom
dblock:fix-chat-text-markdown-mutual-exclusion
Jul 5, 2026
Merged

Mark text/markdown_text arg_group as not required in chat methods#84
dblock merged 1 commit into
slack-ruby:masterfrom
dblock:fix-chat-text-markdown-mutual-exclusion

Conversation

@dblock

@dblock dblock commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Problem

chat.postEphemeral, chat.postMessage, chat.scheduleMessage and chat.update each declare a mutually_exclusive: true arg_group for [text, markdown_text], meaning at most one of them may be given, not that exactly one is required (they may both be omitted as long as another required arg, e.g. attachments or blocks, is present).

However, this arg_group has no required key. Downstream consumers (e.g. slack-ruby-client) default missing required to true for mutually_exclusive groups, which generates an incorrect "exactly one of :text, :markdown_text is required" (XOR) validation instead of an "at most one" (mutually exclusive) validation. This caused a regression each time slack-ruby-client regenerated its API bindings from this repo (see slack-ruby/slack-ruby-client#588), because the fix there could only live as an ephemeral, uncommitted local patch to this submodule's checkout rather than a durable upstream change.

Fix

Add "required": false to the [text, markdown_text] arg_group in all 4 affected chat method JSON files, so consumers can correctly distinguish "at most one" from "exactly one" mutually-exclusive argument groups.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

The [text, markdown_text] mutually_exclusive arg_group in
chat.postEphemeral, chat.postMessage, chat.scheduleMessage and
chat.update was missing a required flag, which downstream consumers
(e.g. slack-ruby-client) interpret as required: true by default,
generating an 'exactly one of' (XOR) validation. In practice these
methods only require at most one of text/markdown_text (they can both
be omitted as long as another required argument, e.g. attachments or
blocks, is present), so add required: false to make this an at-most-one
constraint instead of exactly-one.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Daniel (dB.) Doubrovkine <dblock@dblock.org>
@dblock dblock merged commit 784d1d4 into slack-ruby:master Jul 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant