Title: Generate TypedDict types for input-side models · Issue #666 · apify/apify-client-python · GitHub
Open Graph Title: Generate TypedDict types for input-side models · Issue #666 · apify/apify-client-python
X Title: Generate TypedDict types for input-side models · Issue #666 · apify/apify-client-python
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 dic...
Open Graph 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 ...
X 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 ...
Opengraph URL: https://github.com/apify/apify-client-python/issues/666
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generate TypedDict types for input-side models","articleBody":"## Context\n\nIn 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.\n\nAs discussed in [this comment](https://github.com/apify/apify-client-python/pull/663#issuecomment-4037713076), 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.\n\n## Proposal\n\n- Investigate generating `TypedDict` equivalents from the Pydantic models (or directly from the OpenAPI spec) for models that are used as input parameters.\n- Integrate the generation into the existing model generation pipeline (`uv run poe generate-models`).\n- Replace `dict` with the corresponding `TypedDict` in resource client method signatures.\n","author":{"url":"https://github.com/vdusek","@type":"Person","name":"vdusek"},"datePublished":"2026-03-11T09:23:21Z","url":"https://github.com/apify/apify-client-python/issues/666"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7c367b8d-f476-ae82-c3bf-f4b88739a267 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AAF2:F5AA9:287F581:3738A5F:6B004855 |
| html-safe-nonce | 771eee5ea0dd95174e6d44eb03492b0146106133a8e7b9ea604a63403fe568e2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUYyOkY1QUE5OjI4N0Y1ODE6MzczOEE1Rjo2QjAwNDg1NSIsInZpc2l0b3JfaWQiOiI0MDQ4ODUyNzkxMTI3NDU5OTI1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 222ca710df9c9823f4fbc2e21ca0200321a906447bd3e1bc1e85d3e2358caf2b |
| hovercard-subject-tag | issue:4056976668 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/apify/apify-client-python/666/issue_layout |
| twitter:image | https://opengraph.githubassets.com/71e07d6e8734bd4b56134de8fe7e6805dab3f6f9c2d0ce30a3c689c8fedd5e31/apify/apify-client-python/issues/666 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/71e07d6e8734bd4b56134de8fe7e6805dab3f6f9c2d0ce30a3c689c8fedd5e31/apify/apify-client-python/issues/666 |
| og:image:alt | 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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vdusek |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/apify/apify-client-python git https://github.com/apify/apify-client-python.git |
| octolytics-dimension-user_id | 24586296 |
| octolytics-dimension-user_login | apify |
| octolytics-dimension-repository_id | 164647835 |
| octolytics-dimension-repository_nwo | apify/apify-client-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 164647835 |
| octolytics-dimension-repository_network_root_nwo | apify/apify-client-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width