-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
t-toolingIssues with this label are in the ownership of the tooling team.Issues with this label are in the ownership of the tooling team.
Milestone
Description
Context
In PR #663 (Accept Pydantic models as alternatives to dicts in resource client methods), we introduced union types like dict | WebhookCreate so that users can pass Pydantic model instances instead of plain dicts. However, the dict part of the union is still untyped — users passing dicts get no type safety or autocompletion.
As discussed in this comment, we could replace the generic dict with generated TypedDict types for an additional layer of type safety. For example, instead of dict | WebhookCreate, the signature could be WebhookCreateDict | WebhookCreate, where WebhookCreateDict is a TypedDict with the same fields.
Proposal
- Investigate generating
TypedDictequivalents from the Pydantic models (or directly from the OpenAPI spec) for models that are used as input parameters. - Integrate the generation into the existing model generation pipeline (
uv run poe generate-models). - Replace
dictwith the correspondingTypedDictin resource client method signatures.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
t-toolingIssues with this label are in the ownership of the tooling team.Issues with this label are in the ownership of the tooling team.