feat(methods): add blocks.validate example - #213
Draft
zimeg wants to merge 3 commits into
Draft
Conversation
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>
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>
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 a
blocksmethod-family example forblocks.validate, mirroring the existingchatexample so each Slack API method family has a self-contained, runnable demonstration.methods/src/blocks/blocks_validate.pybuilds blocks with typed model classes (SectionBlock/PlainTextObject) and validates them viaclient.blocks_validate(blocks=...), then prints the response.methods/src/blocks/manifest.json+.slack/config for theblocksexample.blockssection inmethods/README.md's "What's on call" list.blocks.validateis unauthenticated, so the client is created without a token (WebClient()). The method isn't in a publishedslack_sdkrelease yet, so this depends on the SDK change in slackapi/python-slack-sdk#1946;requirements.txtstays on the publishedslack_sdk==3.43.0so the repo keeps building.Testing
chat_post_message.pystructure/style. Run:cd methods/src/blocks && slack run blocks_validate.py.Depends on slackapi/python-slack-sdk#1946.
🤖 Generated with Claude Code