【发布时间】:2021-11-24 03:26:42
【问题描述】:
尝试解决我的应用在向 Google Slides API 发送 batchUpdate 请求后收到的错误消息
Invalid requests[19].updateTableCellProperties: Invalid field: table_cell_properties
批处理中的第 19 个请求是我唯一的 updateTableCellProperties 请求。如果我从批处理中删除第 19 个请求,一切正常。
我在这个batchUpdate 中运行的其他没有问题的请求是insertTableRows、deleteTableRow、insertText、updateParagraphStyle、updateTextStyle、updateTableColumnProperties。它们都在同一张桌子上工作,所以我使用相同的objectId,但根据请求我必须将其指定为tableObjectId 而不是objectId。
不确定我是否为我拥有的唯一一个 updateTableCellProperties 请求生成了错误请求,或者 Google 幻灯片 ruby gem 本身是否存在问题,我尝试从 Google 幻灯片 API 资源管理器发送这个 updateTableCellProperties 请求它对请求结构进行了一些验证。于是我发了this updateTableCellProperties batchUpdate request
{
"requests": [
{
"updateTableCellProperties": {
"objectId": "gf9d8fea71f_22_1",
"tableRange": {
"location": {
"columnIndex": 0,
"rowIndex": 1
}
},
"fields": "tableCellProperties",
"tableCellProperties": {
"tableCellBackgroundFill": {
"solidFill": {
"color": {
"themeColor": "LIGHT1"
}
}
}
}
}
}
]
}
我得到了这个错误:
{
"error": {
"code": 400,
"message": "Invalid requests[0].updateTableCellProperties: Invalid field: table_cell_properties",
"status": "INVALID_ARGUMENT"
}
}
为什么这个updateTableCellProperties 请求被报告为无效?我也对错误消息的输出感到困惑,因为它在蛇的情况下提到了table_cell_properties,而文档只在骆驼的情况下提到了tableCellProperties,我的请求也只在骆驼的情况下提到了tableCellProperties。我只知道在蛇案例和骆驼案例之间转换的红宝石宝石,但这与 API Explorer 无关。
【问题讨论】: