feat(block-kit): add composition object examples - #228
Draft
zimeg wants to merge 2 commits into
Draft
Conversation
Add example projects for the Block Kit composition objects documented on docs.slack.dev, each demonstrating the full reference payload for its object hosted inside a valid block, element, or view. Every example ships a test that asserts the complete serialized JSON. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Rewrite each existing example test's `expected` reference payload so every nested dict is exploded one key:value per line with a magic trailing comma, mirroring the docs' vertical layout and keeping ruff format from re-collapsing short dicts. Values stay native `dict`/`list` literals and the `json.dumps(..., sort_keys=True)` comparison is unchanged. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
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.
Summary
Adds example projects for the Block Kit composition objects documented at docs.slack.dev. Composition objects never appear on their own, so each example reproduces the object's full reference payload hosted inside a valid block, element, or view — exactly as the docs page shows it. Every example ships a test asserting the complete serialized JSON.
Mirrors the conventions of the block element examples PR (#227): one
exampleNN()per docs reference payload undersrc/composition_objects/, matched by a test undertests/composition_objects/comparingto_dict()against the complete expected object.Coverage
slack_iconis documented but has no standalone reference payload (it is a sub-object of the card block, which the SDK does not yet expose), so it is not exemplified here.Checks
Run from
block-kit/, matching thepytest@python3.14CI job:ruff check— passedruff format --diff --check— passed (57 files)mypy .— passed (56 source files)pytest— 45 passed