Skip to content

feat(web-api): add blocks.validate method#2659

Draft
zimeg wants to merge 1 commit into
mainfrom
blocks-validate
Draft

feat(web-api): add blocks.validate method#2659
zimeg wants to merge 1 commit into
mainfrom
blocks-validate

Conversation

@zimeg

@zimeg zimeg commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

This pull request adds a typed blocks.validate method to @slack/web-api.

  • 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 are optional JSON-encoded string arguments; no scopes required.
  • Adds the blocks facet + validate binding, BlocksValidateArguments, a BlocksValidateResponse type (with the errors[] shape: code/message/pointer/related_component), a tsd type test, and a changeset (minor bump).
  • The response type mirrors what scripts/generate-web-api-types.sh produces from the blocks.validate.json sample being added upstream in slackapi/java-slack-sdk (companion PR).

Testing

  • The blocks.validate example in the bolt-js-examples methods/ set exercises this end-to-end against a real workspace; it can be switched from client.apiCall('blocks.validate', …) to client.blocks.validate(…) once this ships.

Requirements

🤖 Generated with Claude Code

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-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ab6ff3c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@slack/web-api Minor

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

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.19%. Comparing base (70e15b8) to head (ab6ff3c).
✅ All tests successful. No failed tests found.

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              
Flag Coverage Δ
cli-hooks 89.19% <100.00%> (+0.02%) ⬆️
cli-test 89.19% <100.00%> (+0.02%) ⬆️
logger 89.19% <100.00%> (+0.02%) ⬆️
oauth 89.19% <100.00%> (+0.02%) ⬆️
socket-mode 89.19% <100.00%> (+0.02%) ⬆️
web-api 89.19% <100.00%> (+0.02%) ⬆️
webhook 89.19% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant