Skip to content

feat: add highlight_type to files.completeUploadExternal and filesUploadV2#1589

Draft
zimeg wants to merge 1 commit into
mainfrom
feat/highlight-type
Draft

feat: add highlight_type to files.completeUploadExternal and filesUploadV2#1589
zimeg wants to merge 1 commit into
mainfrom
feat/highlight-type

Conversation

@zimeg
Copy link
Copy Markdown
Member

@zimeg zimeg commented May 15, 2026

This pull request adds highlight_type support to files.completeUploadExternal and the filesUploadV2 method.

The highlight_type parameter allows specifying the file type hint for uploads (e.g. png, jpg, gif), enabling optimistic rendering before the async upload processing job completes.

📚 https://docs.slack.dev/reference/methods/files.completeUploadExternal

Changes

  • Added highlightType to FilesCompleteUploadExternalRequest.FileDetails (per-file in the files array)
  • Added highlightType to FilesUploadV2Request (top-level for single-file uploads) and FilesUploadV2Request.UploadFile (for multi-file uploads)
  • Updated MethodsClientImpl.filesUploadV2 to pass highlightType through to each FileDetails object in the completion step

Usage

import com.slack.api.Slack;
import com.slack.api.methods.response.files.FilesUploadV2Response;

Slack slack = Slack.getInstance();

// Single file upload with highlight_type
FilesUploadV2Response response = slack.methods(token).filesUploadV2(r -> r
    .channel("C0123456789")
    .file(new File("./image.png"))
    .filename("image.png")
    .title("Image Upload")
    .highlightType("png")
    .initialComment("Uploaded with highlight_type for optimistic rendering")
);

// Multiple file uploads with highlight_type
FilesUploadV2Response response = slack.methods(token).filesUploadV2(r -> r
    .channel("C0123456789")
    .uploadFiles(Arrays.asList(
        FilesUploadV2Request.UploadFile.builder()
            .file(new File("./photo.jpg"))
            .filename("photo.jpg")
            .title("Photo")
            .highlightType("jpg")
            .build(),
        FilesUploadV2Request.UploadFile.builder()
            .file(new File("./diagram.png"))
            .filename("diagram.png")
            .title("Diagram")
            .highlightType("png")
            .build()
    ))
    .initialComment("Multiple files with highlight_type")
);

Related PRs

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)

Requirements

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

…oadV2

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.19%. Comparing base (c636708) to head (685d67f).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../com/slack/api/methods/impl/MethodsClientImpl.java 33.33% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1589      +/-   ##
============================================
+ Coverage     73.17%   73.19%   +0.01%     
- Complexity     4513     4514       +1     
============================================
  Files           477      477              
  Lines         14291    14294       +3     
  Branches       1488     1488              
============================================
+ Hits          10458    10462       +4     
- Misses         2940     2941       +1     
+ Partials        893      891       -2     
Flag Coverage Δ
jdk-14 73.19% <33.33%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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