Skip to content

fix(web-api): blank sample placeholders before generating response types - #2879

Merged
zimeg merged 2 commits into
mainfrom
zimeg-fix-web-api-generator-placeholders
Nov 20, 2026
Merged

zimeg merged 2 commits into
mainfrom
zimeg-fix-web-api-generator-placeholders

Conversation

@zimeg

@zimeg zimeg commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

This pull request changes scripts/code_generator.rb so the placeholders in the slackapi/java-slack-sdk response samples can't narrow the generated @slack/web-api response types.

The java sample recorder masks every ID as <letter>00000000 and every timestamp as 0000000000.000000, and writes map keys as 0000000000, 0000000000_ and so on. quicktype reads a value that repeats across a sample as an enum or a literal type, and reads an object as a map only when every key is digits. Before passing a sample to quicktype, the generator now blanks those placeholder values and renumbers the placeholder keys. The samples stay as recorded.

This regenerates only the two response types the change affects, from the same samples main was generated from:

  • search.all: user, user_id, share_user_id and last_editor were the LastEditor enum ('' | 'U00000000'), and are string now.
  • rtm.start: bots[].app_id, bots[].id and bot_id were the Appid and Id enums ('' | 'A00000000' and '' | 'B00000000'), and are string now.

With these enums, a check like match.user === 'U012ABC' or a typed fixture { user: 'U012ABC' } didn't compile. Neither enum is exported from the package. The other response types come out the same.

#2878 stacks on this pull request and regenerates the rest from the latest samples. There, this change also keeps the search.all and search.files ID fields from becoming enums, and types admin.apps.activities.list function_inputs as { [key: string]: FunctionInput }.

  1. fix(web-api): blank sample placeholders before generating response types #2879 generator placeholders 👈 this pull request
  2. feat(web-api): add webapi response changes as of 2026-11-20 #2878 response types from the latest java samples

Testing

Requirements

🤖 Generated with Claude Code

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg zimeg added this to the web-api@next milestone Nov 20, 2026
@zimeg zimeg added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch area:typescript issues that specifically impact using the package from typescript projects pkg:web-api applies to `@slack/web-api` labels Nov 20, 2026
@zimeg zimeg self-assigned this Nov 20, 2026
@changeset-bot

changeset-bot Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a821590

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 Patch

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 Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.50%. Comparing base (de3e7e5) to head (a821590).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2879      +/-   ##
==========================================
+ Coverage   94.45%   94.50%   +0.05%     
==========================================
  Files          68       68              
  Lines       10942    10942              
  Branches      696      697       +1     
==========================================
+ Hits        10335    10341       +6     
+ Misses        576      571       -5     
+ Partials       31       30       -1     
Flag Coverage Δ
cli-hooks 94.40% <ø> (ø)
cli-test 94.40% <ø> (ø)
logger 94.40% <ø> (ø)
oauth 94.40% <ø> (ø)
socket-mode 94.40% <ø> (ø)
web-api 94.40% <ø> (ø)
webhook 94.40% <ø> (ø)

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.

zimeg added a commit that referenced this pull request Nov 20, 2026
…egen

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg
zimeg marked this pull request as ready for review November 20, 2026 04:06
@zimeg
zimeg requested a review from a team as a code owner November 20, 2026 04:06
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
zimeg added a commit that referenced this pull request Nov 20, 2026
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

@mwbrooks mwbrooks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Thanks @zimeg! Fixing the placeholders in the generator, not in the samples, keeps every future regen from reintroducing these enums.

@zimeg

zimeg commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

🌟 Thanks for the kind review @mwbrooks!

@zimeg
zimeg merged commit 7946a88 into main Nov 20, 2026
22 checks passed
@zimeg
zimeg deleted the zimeg-fix-web-api-generator-placeholders branch November 20, 2026 04:22
zimeg added a commit that referenced this pull request Nov 20, 2026
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:typescript issues that specifically impact using the package from typescript projects bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented pkg:web-api applies to `@slack/web-api` semver:patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants