Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Enhance types generation

未关闭
#3,542 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
nodejs, typescript

调研方向

先从 src/apis/calendar/v3.ts 中链接的 Calendar API 示例附近的生成类型开始,然后将其可选字段与 Google Calendar 资源文档和 issue #3151 进行比较。完成的标准是:类型生成器会在 API 文档将字段标识为必需字段的地方生成必需字段,同时不会笼统地将所有字段都设为可选。

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

描述

priority: p3 size: l type: feature request

Is your feature request related to a problem? Please describe.

Currently, all types are optional, or at least a lot of them. See: https://github.com/search?q=repo:googleapis/google-api-nodejs-client+%22%7C+null%22&type=code So, this leads to an awful development experience.

For example, see Google Calendar API:

https://github.com/googleapis/google-api-nodejs-client/blob/6e8c998cee93dbc79a6f306c2150414b933c22c9/src/apis/calendar/v3.ts#L720

But on the other hand, we can see in docs that some fields are optional and some are not.

https://developers.google.com/calendar/api/v3/reference/events#resource

image

Describe the solution you'd like
I would like to see real types with the minimum amount of optional fields.

Describe alternatives you've considered
Of course, we can check everything manually or disable TypeScript checking at all. But I believe it's not a good solution, as why do we need typings which do not work.
https://github.com/googleapis/google-api-nodejs-client/issues/3151

主要语言
TypeScript
星标
12.3k
派生
2k
平均合并
1 天 19 小时
30 天内合并 PR
21

环境准备

从这里开始

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

googleapis/google-api-nodejs-client 的其他 Issue

查看 googleapis/google-api-nodejs-client 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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