larksuite / larksuite/oapi-sdk-java

AppTableFieldDescription实体JSON解析出现反序列化错误

Open
#88 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
310
Forks
115
PR merge metrics
No merged PRs in 30d

Description

背景

给任意列名添加字段描述,调用此接口解析字段名时报错如下:

java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 266 path $.data.items[2].description

在此之前阅读过飞书开源API文档,在通过client获取数据时添加参数,尝试解决

textFieldAsArray(true)

报错如下:

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 266 path $.data.items[2].description

另外,在添加字段描述之后触发上述BUG,我尝试删除字段描述来恢复原状,但发现JSON字符串解析出来仍会维护一个description空列表,我截取部分JSON解析串如下:
image

复现方式

任意创建多维表格,给任意列名添加字段描述,调用该接口必现JSON反序列化失败

现状及期望
  1. JSON解析反序列化失败
  2. 删除字段描述值仍存在空列表

如上述中,删除之后仍然会存在空列表,如果我想恢复只能通过回滚或者删除该列之后重新创建,但是对于数据量过大的多维表格,这样处理代价太大了,希望飞书团队可以帮忙处理一下该问题

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with sample/src/main/java/com/lark/oapi/sample/apiall/bitablev1/ListAppTableFieldSample.java and reproduce the response after adding and then removing a field description. Trace how AppTableFieldDescription is deserialized, comparing the string, array, and empty-list values reported in the issue. Done means the API response parses successfully in each described state and the resulting description value matches the response.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.