You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9b30e7f
Browse filesBrowse the repository at this point in the historyBrowse files
refactor: Generate all models and TypedDicts from OpenAPI spec
Drop the hand-written `_models.py` and `_typeddicts.py` and rename the
generated files (the `_generated` suffix is no longer needed). All Pydantic
models and TypedDicts now come from `datamodel-codegen` against the OpenAPI
spec, including `WebhookRepresentation` (added to apify-docs in tandem) and
the existing `RequestDraft` / `RequestDraftDelete` shapes.
Resolves#758.
Notable knock-on changes:
- `WebhookRepresentationList` class replaced by a single `encode_webhooks_to_base64`
helper in `_utils.py`.
- `_wait_for_finish` works against a plain dict (each caller already validates
the response into the concrete `Run` / `Build` model), so the hand-written
`ActorJob` / `ActorJobResponse` shapes are no longer needed.
- `RequestInput` -> `RequestDraft`, `RequestDeleteInput` -> `RequestDraftDelete`,
matching the names already used in the spec; the upgrade guide is updated.
Copy file name to clipboardExpand all lines: .rules.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ uv run poe type-check # Run ty type checker
19
19
uv run poe unit-tests # Run unit tests
20
20
uv run poe check-docstrings # Verify async docstrings match sync
21
21
uv run poe fix-docstrings # Auto-fix async docstrings
22
-
uv run poe generate-models # Regenerate _models_generated.py and _typeddicts_generated.py from live OpenAPI spec
22
+
uv run poe generate-models # Regenerate _models.py and _typeddicts.py from live OpenAPI spec
23
23
uv run poe generate-models-from-file <path># Regenerate from a local OpenAPI spec file
24
24
25
25
# Run a single test
@@ -73,7 +73,7 @@ Docstrings are written on sync clients and **automatically copied** to async cli
73
73
74
74
### Data Models
75
75
76
-
`src/apify_client/_models_generated.py` and `src/apify_client/_typeddicts_generated.py` are **auto-generated** — do not edit them manually. The hand-maintained `src/apify_client/_models.py` and `src/apify_client/_typeddicts.py` hold only shapes that are not exposed by the OpenAPI spec (or that need local logic); import generated types directly from the `_*_generated` modules.
76
+
`src/apify_client/_models.py` and `src/apify_client/_typeddicts.py` are **auto-generated** — do not edit them manually. Every Pydantic model and TypedDict comes from the OpenAPI spec.
77
77
78
78
- Generated by `datamodel-code-generator` from the OpenAPI spec at `https://docs.apify.com/api/openapi.json` (config in `pyproject.toml` under `[tool.datamodel-codegen]`, aliases in `datamodel_codegen_aliases.json`)
79
79
- After generation, `scripts/postprocess_generated_models.py` is run to apply additional fixes
0 commit comments