feat(openapi): Add WebhookRepresentation schema for ad-hoc webhooks#2469
Merged
feat(openapi): Add WebhookRepresentation schema for ad-hoc webhooks#2469
Conversation
Document the actual shape of the Base64-encoded JSON array passed via the `webhooks` query parameter on Actor run/build endpoints. The new schema is referenced via `contentSchema` so consumers can decode and validate the payload, and the apify-client-python codegen can generate a typed model instead of hand-maintaining one.
fnesveda
approved these changes
Apr 28, 2026
|
Preview for this PR was built for commit |
|
Important Action required — @vdusek please coordinate this docs PR with the Python API client PR linked below. Because this PR modifies the OpenAPI specification, the generated models in A companion PR has been opened in
|
vdusek
added a commit
to apify/apify-client-python
that referenced
this pull request
Apr 28, 2026
This PR updates the auto-generated Pydantic models and TypedDicts based on OpenAPI specification changes in [apify-docs PR #2469](apify/apify-docs#2469). Co-authored-by: Vlada Dusek <v.dusek96@gmail.com>
vdusek
added a commit
to apify/apify-client-python
that referenced
this pull request
Apr 29, 2026
Closes: #758 ## Summary Every Pydantic model and TypedDict now comes from the OpenAPI spec — no more hand-maintained shapes alongside the generated ones. - Deleted the hand-written `src/apify_client/_models.py` and `src/apify_client/_typeddicts.py`. - Renamed `_models_generated.py` → `_models.py`, `_typeddicts_generated.py` → `_typeddicts.py`. The `_generated` suffix is no longer needed now that there is no parallel hand-written file. - Regenerated models pick up the new `WebhookRepresentation` schema added in apify/apify-docs#2469. ### Knock-on changes - `WebhookRepresentationList` class is gone — replaced by a single `encode_webhooks_to_base64()` helper in `_utils.py`. Callers in `actor.py` / `task.py` simplified to `webhooks=encode_webhooks_to_base64(webhooks)`. - `_wait_for_finish` already returns a plain dict and each caller validates it against the concrete `Run` / `Build` model, so the hand-written `ActorJob` / `ActorJobResponse` shapes are no longer needed. - `RequestInput` → `RequestDraft`, `RequestDeleteInput` → `RequestDraftDelete` (and matching `*Dict` names) — these were hand-rolled aliases for shapes that are already in the spec under the canonical names. The v3 upgrade guide is updated to match. - Bumped `RESOURCE_INPUT_TYPEDDICTS` in `scripts/postprocess_generated_models.py` to seed the typed-dict reachability walk with `RequestDraft`, `RequestDraftDelete`, and `WebhookRepresentation`. - Updated lint per-file-ignores from `_*_generated.py` to `_{models,typeddicts}.py` to match the new filenames. ## Pairs with - apify/apify-docs#2469 — adds the `WebhookRepresentation` schema component and references it from the `webhooks` query parameter. The docs PR should land first; this PR's regenerated models depend on it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WebhookRepresentationschema describing the minimal ad-hoc webhook shape (eventTypes,requestUrl, optionalpayloadTemplate/headersTemplate).contentSchemaon thewebhooksquery parameter (used on Actor/task run and build endpoints), so the parameter now documents the actual decoded structure of the Base64-encoded JSON array instead of a vague free-form description.Why
The
webhooksquery parameter is hand-maintained inapify-client-pythonbecause the spec didn't expose its decoded shape. Lifting it into the spec lets the client generate the model from codegen (apify/apify-client-python#758) and keeps the API reference accurate for any other consumer.Related
WebhookRepresentationmodel in favor of the generated one.