Skip to content

feat(methods): add blocks.validate method#1622

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

feat(methods): add blocks.validate method#1622
zimeg wants to merge 1 commit into
mainfrom
blocks-validate

Conversation

@zimeg

@zimeg zimeg commented Jul 14, 2026

Copy link
Copy Markdown
Member

This pull request adds the blocks.validate Web API method to the Slack API client for Java.

  • Callers can validate Block Kit payloads via slack.methods(token).blocksValidate(req) and the async equivalent slack.methodsAsync(token).blocksValidate(req).
  • blocks, message, and view are accepted as JSON-encoded String arguments (all optional; the API expects exactly one). No scopes required.
  • Adds: the BLOCKS_VALIDATE endpoint constant, sync + async interface methods and implementations, the RequestFormBuilder mapping, BlocksValidateRequest / BlocksValidateResponse model classes (the response includes an errors[] list of code/message/pointer/relatedComponent), the Tier3 rate limit and metadata entry, a test_locally test, and a blocks.validate.json response sample.

Category (place an x in each of the [ ])

  • bolt (Bolt for Java)
  • bolt-{sub modules} (Bolt for Java - optional modules)
  • slack-api-client (Slack API Clients)
  • slack-api-model (Slack API Data Models)
  • slack-api-*-kotlin-extension (Kotlin Extensions for Slack API Clients)
  • slack-app-backend (The primitive layer of Bolt for Java)

Testing

  • Run ./mvnw test -pl slack-api-client -Dtest=test_locally.api.methods.BlocksTest and confirm both the sync and async cases pass against the mock Slack API server.

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.

🤖 Generated with Claude Code

Add the blocks.validate Web API method to the Slack API client. Callers
can validate Block Kit payloads via methods().blocksValidate(req) (and the
async equivalent), passing blocks, message, or view as JSON-encoded
strings. No scopes are required.

Adds the endpoint constant, sync and async interface methods and impls,
the request form builder, the request/response model classes (with an
errors[] list of code/message/pointer/relatedComponent), the Tier3 rate
limit, a local test, and a response sample for type generation.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@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 73.31%. Comparing base (4d86807) to head (a7c05c7).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1622      +/-   ##
============================================
+ Coverage     73.30%   73.31%   +0.01%     
- Complexity     4518     4524       +6     
============================================
  Files           478      478              
  Lines         14300    14310      +10     
  Branches       1490     1490              
============================================
+ Hits          10483    10492       +9     
- Misses         2925     2930       +5     
+ Partials        892      888       -4     
Flag Coverage Δ
jdk-14 73.31% <100.00%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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