Skip to content

feat(openapi): Add WebhookRepresentation schema for ad-hoc webhooks#2469

Merged
vdusek merged 1 commit intomasterfrom
feat/webhook-representation-schema
Apr 28, 2026
Merged

feat(openapi): Add WebhookRepresentation schema for ad-hoc webhooks#2469
vdusek merged 1 commit intomasterfrom
feat/webhook-representation-schema

Conversation

@vdusek
Copy link
Copy Markdown
Contributor

@vdusek vdusek commented Apr 28, 2026

Summary

  • Adds a new WebhookRepresentation schema describing the minimal ad-hoc webhook shape (eventTypes, requestUrl, optional payloadTemplate / headersTemplate).
  • References it via contentSchema on the webhooks query 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 webhooks query parameter is hand-maintained in apify-client-python because 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

  • Pairs with the apify-client-python PR that drops the hand-written WebhookRepresentation model in favor of the generated one.

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.
@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Apr 28, 2026
@vdusek vdusek self-assigned this Apr 28, 2026
@vdusek vdusek requested a review from Pijukatel April 28, 2026 08:04
@github-actions github-actions Bot added this to the 139th sprint - Tooling team milestone Apr 28, 2026
@apify-service-account
Copy link
Copy Markdown

Preview for this PR was built for commit 7ddd61c and is ready at https://pr-2469.preview.docs.apify.com!

@apify-service-account
Copy link
Copy Markdown

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 apify-client-python must be regenerated to stay in sync. This has already been done automatically:

A companion PR has been opened in apify-client-python with the regenerated models: apify/apify-client-python#767

  • Please make sure to review and merge both PRs together to keep the OpenAPI spec and API clients in sync.
  • You can ask for review and help from the Tooling team if needed.

@vdusek vdusek changed the title docs(openapi): Add WebhookRepresentation schema for ad-hoc webhooks feat(openapi): Add WebhookRepresentation schema for ad-hoc webhooks Apr 28, 2026
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 vdusek merged commit 599443b into master Apr 28, 2026
16 of 18 checks passed
@vdusek vdusek deleted the feat/webhook-representation-schema branch April 28, 2026 08:37
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants