ListRecord.Field array-shaped `message` still fails in the production GsonFactory (follow-up to #1587) · Issue #1653 · slackapi/java-slack-sdk · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ListRecord.Field array-shaped message still fails in the production GsonFactory (follow-up to #1587) #1653
When the Slack API returns a conversations.replies (or conversations.history) response that contains a Slack Lists item attachment, the SDK throws JsonSyntaxException whenever any ListRecord.Field.message value is a JSON array instead of a single object. The whole API call fails, and no Message data is returned.
This is the bug from #1587. #1590 (released in v1.49.0) closed #1587, but the bug is still in the production code path in v1.52.0.
ListRecord.Field (slack-api-model/src/main). It added private transient List<Message> messages and getMessages() / setMessages(). The field message is still a single Message. Gson skips transient fields and sets fields by reflection, not through setters. So without an adapter, Gson still maps the JSON key message to the Message field, and an array still fails.
GsonListRecordFieldFactory, the adapter that converts the array. fix(model): handle array format for ListRecord.Field message deserial… #1590 put it in slack-api-model/src/test/java/test_locally/util/list/ and registered it only in the test GsonFactory (slack-api-model/src/test/java/test_locally/unit/GsonFactory.java).
ListRecordFieldTest parses with that test GsonFactory, so it passes. Real API calls parse with com.slack.api.util.json.GsonFactory in slack-api-client (MethodsClientImpl calls GsonFactory.createSnakeCase(config)), and that class does not register the adapter. Also, the json-logs/samples/api samples still have message as a single object, so the MockSlackApi tests (for example ConversationsTest) never see the array shape.
Minimal reproduction
importcom.google.gson.Gson;
importcom.slack.api.methods.response.conversations.ConversationsRepliesResponse;
importcom.slack.api.util.json.GsonFactory;
publicclassRepro {
publicstaticvoidmain(String[] args) {
// Mirrors the shape Slack returns when a Lists item's `message` field// has multiple values (array form).Stringpayload =
"{\"ok\":true,\"messages\":[{\"type\":\"message\",\"user\":\"U1\",\"ts\":\"1.0\","
+ "\"text\":\"hi\",\"attachments\":[{\"list_record\":{\"record\":{\"fields\":["
+ "{\"key\":\"name\",\"message\":{\"text\":\"ok\"}},"
+ "{\"key\":\"details\",\"message\":[{\"text\":\"a\"},{\"text\":\"b\"}]}"
+ "]}}}]}]}";
GsonsdkGson = GsonFactory.createSnakeCase();
// Still throws JsonSyntaxException on v1.52.0 at// $.messages[0].attachments[0].list_record.record.fields[1].messageConversationsRepliesResponseparsed =
sdkGson.fromJson(payload, ConversationsRepliesResponse.class);
}
}
Expected behavior
The SDK accepts both single-object and array shapes for ListRecord.Field.message in real API responses, as getMessages() from #1590 intends.
Proposed fix
#1654 moves GsonListRecordFieldFactory to slack-api-model/src/main/java/com/slack/api/util/json/ (next to GsonListViewGroupingFactory) and registers it in GsonFactory.registerTypeAdapters.
Hi @srtaalej@zimeg, a quick follow-up: is there a target release or milestone for #1637? It is still a draft, and its description says it needs a decision on the breaking change. Until it ships, conversations.replies fails for every thread with a Slack List unfurl. Thanks!
Activity
fix(model): register ListRecord.Field adapter in GsonFactory
bkyryliuk commentedon Oct 9, 2026
Thanks! Per #1654, the fix will land with #1637.
bkyryliuk commentedon Oct 13, 2026
Hi @srtaalej @zimeg, a quick follow-up: is there a target release or milestone for #1637? It is still a draft, and its description says it needs a decision on the breaking change. Until it ships,
conversations.repliesfails for every thread with a Slack List unfurl. Thanks!