Skip to content

Add card block support#456

Open
VictorHLi404 wants to merge 5 commits into
masterfrom
vili/card-block-support
Open

Add card block support#456
VictorHLi404 wants to merge 5 commits into
masterfrom
vili/card-block-support

Conversation

@VictorHLi404

Copy link
Copy Markdown
Contributor

Summary

  • Adds CardIF for Slack's card block, following the same pattern as vili/table-block-support
  • Adds SlackIconObjectIF as a new composition object for the card's slack_icon field
  • Reuses existing elements.Image for hero_image/icon and Text for text fields
  • actions is modeled as Optional<List<BlockElement>> (flat array, not a wrapped Actions block)
  • Registers Card in Block.java's @JsonSubTypes and adds card-specific limits to BlockElementLengthLimits

Test plan

  • CardBlockTest covers round-trip deserialization for all 5 payload shapes (slack_icon+actions, hero_image, icon+actions, title-only, actions-only)
  • Validation tests assert failures for: missing required fields, icon+slack_icon together, title >150 chars, body >200 chars, actions >3 elements

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

@yyakhnytsia yyakhnytsia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed, left comments.

Comment thread slack-base/src/main/java/com/hubspot/slack/client/models/blocks/CardIF.java Outdated
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.

2 participants