Mark text/markdown_text arg_group as not required in chat methods#84
Merged
dblock merged 1 commit intoJul 5, 2026
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
chat.postEphemeral,chat.postMessage,chat.scheduleMessageandchat.updateeach declare amutually_exclusive: truearg_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.attachmentsorblocks, is present).However, this arg_group has no
requiredkey. Downstream consumers (e.g. slack-ruby-client) default missingrequiredtotrueformutually_exclusivegroups, 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": falseto 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