Skip to content

feat: add webapi response changes as of 2026-08-22 - #1636

Open
slackapi[bot] wants to merge 13 commits into
mainfrom
api
Open

feat: add webapi response changes as of 2026-08-22#1636
slackapi[bot] wants to merge 13 commits into
mainfrom
api

Conversation

@slackapi

@slackapi slackapi Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

This PR updates the web API client and model based on the production E2E test results.

Category

  • slack-api-model (Slack API Data Models)

Requirements

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

@slackapi
slackapi Bot requested a review from a team as a code owner August 22, 2026 00:54
@slackapi slackapi Bot added project:slack-api-model project:slack-api-model semver:patch labels Aug 22, 2026
@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

❌ 22 Tests Failed:

Tests completed Failed Passed Skipped
887 22 865 11
View the top 3 failed test(s) by shortest run time
test_locally.api.methods.RTMTest::test
Stack Traces | 0.034s run time
java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 405150 path $.groups[0].latest.attachments[0].list_record.record.fields[0].message
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure
test_locally.api.methods.SlackListsTest::slackListsItemsCreate
Stack Traces | 0.036s run time
java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 912 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure
test_locally.api.methods.SlackListsTest::slackListsAccessSet
Stack Traces | 0.04s run time
java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 63 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure
test_locally.api.methods.SlackListsTest::slackListsItemsUpdate
Stack Traces | 0.04s run time
java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 63 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure
test_locally.api.methods.SlackListsTest::slackListsAccessSet_async
Stack Traces | 0.044s run time
MethodsCompletionException(ioException=null, slackApiException=null, otherException=com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 63 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure)
test_locally.api.methods.SlackListsTest::slackListsDownloadStart
Stack Traces | 0.044s run time
java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 78 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure
test_locally.api.methods.SlackListsTest::slackListsItemsInfo_async
Stack Traces | 0.044s run time
MethodsCompletionException(ioException=null, slackApiException=null, otherException=com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 4640 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure)
test_locally.api.methods.SlackListsTest::slackListsItemsList
Stack Traces | 0.044s run time
java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 1599 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure
test_locally.api.methods.SlackListsTest::slackListsAccessDelete_async
Stack Traces | 0.045s run time
MethodsCompletionException(ioException=null, slackApiException=null, otherException=com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 63 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure)
test_locally.api.methods.SlackListsTest::slackListsDownloadGet
Stack Traces | 0.045s run time
java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 99 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure
test_locally.api.methods.SlackListsTest::slackListsUpdate
Stack Traces | 0.045s run time
java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 63 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure
test_locally.api.methods.SlackListsTest::slackListsAccessDelete
Stack Traces | 0.047s run time
java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 63 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure
test_locally.api.methods.SlackListsTest::slackListsDownloadGet_async
Stack Traces | 0.047s run time
MethodsCompletionException(ioException=null, slackApiException=null, otherException=com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 99 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure)
test_locally.api.methods.SlackListsTest::slackListsUpdate_async
Stack Traces | 0.047s run time
MethodsCompletionException(ioException=null, slackApiException=null, otherException=com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 63 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure)
test_locally.api.methods.SlackListsTest::slackListsItemsList_async
Stack Traces | 0.049s run time
MethodsCompletionException(ioException=null, slackApiException=null, otherException=com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 1599 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure)
test_locally.api.methods.SlackListsTest::slackListsItemsInfo
Stack Traces | 0.05s run time
java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 4640 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure
test_locally.api.methods.SlackListsTest::slackListsItemsCreate_async
Stack Traces | 0.053s run time
MethodsCompletionException(ioException=null, slackApiException=null, otherException=com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 912 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure)
test_locally.api.methods.SlackListsTest::slackListsItemsDeleteMultiple
Stack Traces | 0.053s run time
java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 63 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure
test_locally.api.methods.SlackListsTest::slackListsDownloadStart_async
Stack Traces | 0.055s run time
MethodsCompletionException(ioException=null, slackApiException=null, otherException=com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 78 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure)
test_locally.api.methods.SlackListsTest::slackListsItemsDeleteMultiple_async
Stack Traces | 0.056s run time
MethodsCompletionException(ioException=null, slackApiException=null, otherException=com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 63 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure)
test_locally.api.methods.SlackListsTest::slackListsItemsUpdate_async
Stack Traces | 0.074s run time
MethodsCompletionException(ioException=null, slackApiException=null, otherException=com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 63 path $.response_metadata.messages[0]
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure)
test_locally.SlackTest::rtmStart
Stack Traces | 0.317s run time
java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 405150 path $.groups[0].latest.attachments[0].list_record.record.fields[0].message
See https://github..../blob/main/Troubleshooting.md#unexpected-json-structure

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

zimeg and others added 8 commits August 24, 2026 13:51
Detected by the runner's audit-log test (getActions_detectingNewOnes)
as an unknown App action returned by the live audit API.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
The live audit API returns this action under getUser(), not getApp()
(confirmed by a local task test:audit run). a205d62 declared it in
Actions.App, so getActions_detectingNewOnes still failed on the User
loop. Move it to the correct bucket.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
The sample-JSON masker blanks the Lists item `message` field to `[""]`
because the live value is often empty, which makes downstream type
generation infer `string[]` instead of the message-object shape the API
actually returns. Add a path-gated (`/api/slackLists.`) branch that
injects a populated Message, so the sample reflects the real object shape.

Fixes the sample side of slackapi/node-slack-sdk#2598 (wrong TS response
type). Separate from java-slack-sdk#1587, the already-fixed runtime
deserialization crash.

❤️
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
The Lists item `message` field response is an array of message references,
verified against the live API on two surfaces (slackLists.items.list and the
conversations.replies/history nested list_record path): both return
List<{value, channel_id, ts, thread_ts?}>, always an array, with thread_ts
present only for threaded-reply references. No single-object form was
observed on either endpoint.

This replaces the earlier `Message`-typed modeling (#1590), whose element
type (a full chat Message) does not match the actual payload, and whose
single-object/array normalization handled a shape the API does not return.
The custom test deserializer is reduced to a pass-through and its tests are
rewritten against the verified MessageRef shape.

EXPERIMENTAL / not final: this fixes the RESPONSE shape only. The request
side of the field takes an array of permalink URL strings (List<String>),
which this single type does not model — the request/response split still
needs a design decision (see the PR discussion). Marking experimental so it
is reviewed, not merged as-is.

❤️
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg

zimeg commented Aug 25, 2026

Copy link
Copy Markdown
Member

⚠️ EXPERIMENTAL — Slack Lists message field re-typed as List<MessageRef> (388afd370)

Pushed an experimental change to how ListRecord.Field.message is modeled. Not final — do not merge as-is. Flagging it here with full context for review.

What changed

ListRecord.Field.message is now List<ListRecord.MessageRef> where MessageRef = { value, channel_id, ts, thread_ts? }. The prior Message-typed modeling (#1590) is replaced; the test-tree GsonListRecordFieldFactory is reduced to a pass-through and its tests rewritten against the new shape.

Why — verified against the live API

The response shape was confirmed empirically on two surfaces, across single/threaded/multi-reference scenarios:

Both return the message field as [{ "value": "<permalink>", "channel_id": "C…", "ts": "…", "thread_ts"?: "…" }]always an array, with thread_ts present only when the referenced message is a threaded reply. No single-object form was observed on either endpoint. Element is a message reference, not a chat message. Field-type reference: slackLists.items.create#field-types.

This means the earlier Message element type did not match the payload, and the single-object↔array normalization added in #1590 handled a shape the API does not actually return on these endpoints.

Open question (the reason this is experimental)

This fixes the response only. The request side of the field takes an array of permalink URL strings (List<String>) — verified: the API rejects object form with must provide a string [json-pointer:/initial_fields/0/message/0]. A single Field.message type cannot serve both directions. The request/response split still needs a design decision (direction-aware types, or bring Lists types under codegen). This is the same request-vs-response tension previously seen on the Node side.

Related / for later reference

  • #1590 — the earlier Java array-deserialization fix (runtime crash) that this supersedes on the model side.
  • java-slack-sdk ListRecord.Field.message` deserialization fails when Slack returns an array #1587 — the runtime JsonSyntaxException on array-shaped message; fixed (that was a crash; distinct from this typing question).
  • node-slack-sdk #2598 — the analogous Node bug: the generated response type is wrong for this field. This model fix is the upstream half of resolving it (Node response types generate from Java samples).
  • node-slack-sdk #2599 / #2600 — hand-split attempts at #2598 that modeled Message | Message[]; obsolete — they used the wrong element type and an unnecessary union (the field is array-only, and the element is a reference, not a Message).

Verification was done against a test workspace; a few throwaway probe lists (clack probe …) were created there and can be cleaned up.

zimeg and others added 4 commits August 25, 2026 08:43
With ListRecord.Field.message typed as List<MessageRef>, the message field
needs no custom normalization — default Gson deserialization is correct — so
the adapter had been reduced to a pass-through. Delete it and drop its
registration in the test GsonFactory. ListRecordFieldTest still passes.

❤️
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
…age field + remote test coverage

Adds a Gson adapter so a single List<MessageRef> models the asymmetric Lists
message field correctly in both directions (verified against the live API):
- request: serializes each MessageRef to its `value` -> message: ["<permalink>"]
  (the API rejects object form: "must provide a string")
- response: deserializes {value, channel_id, ts, thread_ts?} objects (and
  tolerates bare-string elements defensively)

Registers the adapter in both the main and test GsonFactory. Extends the
remote slacklists_Test to add a message column, post a message, reference it
by permalink, and assert the echoed reference shape — so the generated sample
carries the real message field instead of a degenerate [""]. The live remote
test passes (3/3) and the raw capture shows the correct
{value, channel_id, ts} shape.

Still EXPERIMENTAL / not final (see PR discussion): this is the response/
request modeling for the message field via one type; review before merge. The
committed sample is regenerated by the runner from this capture.

Fixes the Java half of node-slack-sdk#2598 (node response types generate from
these Java samples). Supersedes the Message-typed modeling from #1590 for this
field.

❤️
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant