slackLists.items.list: LinkField originalUrl/displayName are always null (response uses camelCase keys)

未关闭 适合新手
#1,679 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
62/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
java
领域
api

调研方向

问题出在 ListRecord.LinkField 的反序列化方式上:它的字段使用 snake_case 命名,而 slackLists.items.list 返回的是 camelCase 键。请从模型中的 LinkField 类开始,检查它带有哪些 @SerializedName 注解,然后用包含 originalUrl 和 displayName 的 JSON 固定数据复现问题。完成标准是:getOriginalUrl() 和 getDisplayName() 返回固定数据中的值,并且现有的 create/update 请求结构仍然按 snake_case 序列化。

由索引模型根据 Issue 内容生成。

描述

Summary

slackLists.items.list returns link cells with camelCase keys (originalUrl, displayAsUrl, displayName), but ListRecord.LinkField is deserialized with the SDK's snake_case naming, so it expects original_url, display_as_url and display_name. As a result, every LinkField read back from a list has originalUrl == null and displayName == null.

Writing works: slackLists.items.create and slackLists.items.update accept the snake_case request shape that the SDK sends.

Reproduce
  1. Create a list with a link column and add a row whose link cell has original_url and display_name (through the SDK).
  2. Call slackLists.items.list through MethodsClient#slackListsItemsList.
  3. For the link field of the row: field.getLink().get(0).getOriginalUrl() is null. field.getValue() holds the link as JSON with camelCase keys, for example:
{"originalUrl":"https://github.com/org/repo/pull/7","attachment":{},"displayAsUrl":false,"displayName":"repo#7"}
Expected

getOriginalUrl() and getDisplayName() return the values Slack sent, for example with @SerializedName(value = "original_url", alternate = "originalUrl") on the LinkField fields.

Versions
  • com.slack.api:slack-api-client and slack-api-model 1.51.0
  • Java 25
主要语言
Java
星标
602
派生
239
平均合并
1 天 8 小时
30 天内合并 PR
18

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

slackapi/java-slack-sdk 的其他 Issue

查看 slackapi/java-slack-sdk 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。