Calendar PATCH schema rejects null needed to clear date/dateTime for in-place conversion

未关闭
#951 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

  • #964 来自 @tridev-tej —— 已关闭,未合并

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
rust
领域
api, cli

调研方向

Start by reproducing the gws calendar events patch command with --dry-run, then trace the request-body schema validation that rejects null values. Confirm the behavior for clearing start.date and end.date during date/dateTime conversion, and verify that the PATCH request is accepted without the workaround of using a full update.

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

描述

gws calendar events patch rejects JSON null during schema validation, so a PATCH can't clear start.date/end.date when converting an all-day event to a timed one (or dateTime going the other way).

Repro (gws 0.22.5, no credentials needed):

gws calendar events patch \
  --params '{"calendarId":"synthetic-test","eventId":"synthetic-event"}' \
  --json '{"start":{"date":null,"dateTime":"2026-10-10T10:00:00-07:00"},"end":{"date":null,"dateTime":"2026-10-10T11:00:00-07:00"}}' \
  --dry-run
error[validation]: Request body failed schema validation:
- end.date: Expected type 'string', found null
- start.date: Expected type 'string', found null

Without the null, the existing date is kept and the Calendar API rejects the request with Invalid start time.

Expected: null accepted for optional fields in PATCH bodies, since that is how the API clears them.

Workaround: events get, replace start/end, then events update (full PUT).

主要语言
Rust
星标
32.3k
派生
2k
平均合并
16 小时 3 分钟
30 天内合并 PR
1

环境准备

从这里开始

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

googleworkspace/cli 的其他 Issue

查看 googleworkspace/cli 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

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