Skip to content

feat(methods): add blocks.validate example - #213

Merged
zimeg merged 5 commits into
mainfrom
blocks-validate-example
Aug 27, 2026
Merged

feat(methods): add blocks.validate example#213
zimeg merged 5 commits into
mainfrom
blocks-validate-example

Conversation

@zimeg

@zimeg zimeg commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

Adds a blocks method-family example for blocks.validate, mirroring the existing chat example so each Slack API method family has a self-contained, runnable demonstration.

  • methods/src/blocks/blocks_validate.py builds blocks with typed model classes (SectionBlock / PlainTextObject) and validates them via client.blocks_validate(blocks=...), then prints the response.
  • methods/src/blocks/manifest.json + .slack/ config for the blocks example.
  • A blocks section in methods/README.md's "What's on call" list.

blocks.validate is unauthenticated, so the client is created without a token (WebClient()). The method isn't in a published slack_sdk release yet, so this depends on the SDK change in slackapi/python-slack-sdk#1946; requirements.txt stays on the published slack_sdk==3.43.0 so the repo keeps building.

Testing

  • The example compiles and follows the chat_post_message.py structure/style. Run: cd methods/src/blocks && slack run blocks_validate.py.

Depends on slackapi/python-slack-sdk#1946.

🤖 Generated with Claude Code

Add a blocks method-family example that validates a Block Kit payload built
with typed model classes (SectionBlock / PlainTextObject), mirroring the
chat.postMessage example. blocks.validate is unauthenticated, so the client
is created without a token.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg zimeg added the enhancement New feature or request label Aug 26, 2026
@zimeg zimeg self-assigned this Aug 26, 2026
zimeg and others added 4 commits August 26, 2026 10:16
blocks.validate is unauthenticated, so the example app needs no bot scopes
or bot user.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Expand blocks=[...] one entry per line (magic trailing comma) so the
list-of-blocks shape reads clearly and scales when a reader adds
another block.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg
zimeg marked this pull request as ready for review August 27, 2026 08:13
@zimeg
zimeg requested a review from a team as a code owner August 27, 2026 08:13
@zimeg
zimeg merged commit 3e506df into main Aug 27, 2026
7 checks passed
@zimeg
zimeg deleted the blocks-validate-example branch August 27, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant