Skip to content

Generate TypedDict types for input-side models #666

Closed

Description

@vdusek

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 TypedDict equivalents 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 dict with the corresponding TypedDict in resource client method signatures.

Activity

  1. added
    t-toolingIssues with this label are in the ownership of the tooling team.
    on Mar 11, 2026
  2. self-assigned this
    on Mar 11, 2026
  3. added this to the 3.0 milestone on Mar 11, 2026
  4. added 6 commits that reference this issue on Apr 17, 2026
    1eb5c1d
    f63bb00
    00f228a
    54dba8f
    af1d9fa
    2fd66d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions