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 摘要。