fix(openapi): add missing ad-hoc webhook fields to WebhookRepresentation#2640
Conversation
|
🗑️ Preview for this PR was deleted. |
|
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
|
|
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 The companion
|
This PR updates the auto-generated Pydantic models and TypedDicts based on OpenAPI specification changes in [apify-docs PR #2640](apify/apify-docs#2640). On top of the regenerated models, it fixes a related bug: ad-hoc webhooks passed to `start()` / `call()` silently dropped `idempotency_key`, `ignore_ssl_errors` and `do_not_retry`. `WebhookRepresentation` declared only the four templating fields, and `encode_webhooks_to_base64` keeps only declared fields, so these three never reached the platform. The platform accepts and honors all three for ad-hoc webhooks (verified in apify-core: the run-start handler feeds them into the same webhook-creation path as the create-webhook endpoint, including the `idempotencyKey` dedup). What changed: - The regenerated models add the three fields to `WebhookRepresentation` and both webhook-representation typed dicts (snake_case + camelCase). - Reworks the `WebhookCreate` / dict projection in `encode_webhooks_to_base64` to filter by the fields `WebhookRepresentation` declares, instead of hand-listing them. New ad-hoc fields now flow through automatically, so this class of silent-drop bug cannot recur. Unblocks apify/apify-sdk-python#963, which forwards these fields from the SDK `Webhook` dataclass. --------- Co-authored-by: Vlada Dusek <v.dusek96@gmail.com>
Description
WebhookRepresentationschema (items of the Base64-encodedwebhooksquery parameter on the run/build endpoints) declared onlyeventTypes,requestUrl,payloadTemplateandheadersTemplate, but the platform accepts and honors more fields for ad-hoc webhooks: the run-start handler spreads each webhook object into the sameinsertWebhookpath used by the create-webhook endpoint, including theidempotencyKeydedup logic.idempotencyKey,ignoreSslErrorsanddoNotRetryproperties to the schema, so generated API clients (e.g.apify-client-python) stop dropping them.