feat(web-api): add blocks.validate method#2659
Draft
zimeg wants to merge 1 commit into
Draft
Conversation
Add a typed blocks.validate method so callers can validate Block Kit
payloads via client.blocks.validate({ blocks }) instead of the untyped
client.apiCall('blocks.validate', ...) escape hatch. blocks, message, and
view arguments are all optional JSON-encoded strings; no scopes required.
The response type is a minimal placeholder covering the fields common to
all Web API responses; the errors[] array on a failed validation is left
to be generated from a real sample (no blocks.validate.json exists in the
upstream java-slack-sdk logs yet).
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
🦋 Changeset detectedLatest commit: ab6ff3c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2659 +/- ##
==========================================
+ Coverage 89.17% 89.19% +0.02%
==========================================
Files 65 65
Lines 10339 10349 +10
Branches 474 474
==========================================
+ Hits 9220 9231 +11
+ Misses 1091 1090 -1
Partials 28 28
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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
This pull request adds a typed
blocks.validatemethod to@slack/web-api.client.blocks.validate({ blocks })instead of the untypedclient.apiCall('blocks.validate', …)escape hatch.blocks,message, andvieware optional JSON-encoded string arguments; no scopes required.blocksfacet +validatebinding,BlocksValidateArguments, aBlocksValidateResponsetype (with theerrors[]shape:code/message/pointer/related_component), atsdtype test, and a changeset (minor bump).scripts/generate-web-api-types.shproduces from theblocks.validate.jsonsample being added upstream in slackapi/java-slack-sdk (companion PR).Testing
blocks.validateexample in the bolt-js-examplesmethods/set exercises this end-to-end against a real workspace; it can be switched fromclient.apiCall('blocks.validate', …)toclient.blocks.validate(…)once this ships.Requirements
🤖 Generated with Claude Code