googleapis / googleapis/google-api-nodejs-client
Enhance types generation
- Vorherrschende Sprache
- TypeScript
- Sterne
- 12.2k
- Forks
- 2k
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 24
Beschreibung
**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

**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
Beitragsleitfaden
Rechercherichtung
Beginne mit dem generierten Typ in src/apis/calendar/v3.ts im Bereich des verknüpften Calendar API-Beispiels und vergleiche dann seine optionalen Felder mit der Dokumentation der Google Calendar-Ressource und Issue #3151. Die Aufgabe wäre erledigt, wenn der Typgenerator erforderliche Felder erzeugt, wo die API-Dokumentation sie als erforderlich ausweist, ohne allgemein jedes Feld optional zu machen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- nodejs, typescript
- Bereich
- api, developer-experience, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100