Skip to content

fix: Mark generated model fields that the API can omit as optional - #979

Closed
apify-service-account wants to merge 2 commits into
masterfrom
update-models-manual
Closed

fix: Mark generated model fields that the API can omit as optional#979
apify-service-account wants to merge 2 commits into
masterfrom
update-models-manual

Conversation

@apify-service-account

@apify-service-account apify-service-account commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Regenerates the auto-generated Pydantic models and TypedDicts from the latest published OpenAPI specification.

The spec change mostly relaxes fields that were declared required but can be absent in real API responses, so deserializing such responses no longer raises a ValidationError:

  • BuildStats.compute_units and RunStats.compute_units are now optional.
  • RunStats.restart_count and RunStats.resurrect_count are now optional.
  • KeyValueStoreStats.read_count, write_count, delete_count and list_count are now optional.
  • WebhookStats.total_dispatches is now optional.
  • Webhook.request_url is now optional - it is omitted or null for hook actions other than the conventional HTTP case (e.g. Slack or email notifications). Documented on both Webhook and WebhookDispatchWebhookSummary.
  • StoreListActor.current_pricing_info is now optional.
  • UserPrivateInfo.proxy is now optional.
  • RunOptions.max_items now allows 0 (constraint relaxed from ge=1 to ge=0).
  • New error code literal: cannot-monetize-without-payout-billing-info.
  • Docs: TaggedBuildInfo.build_number notes it can be null for legacy builds; the Dataset.schema docs link now points to https://docs.apify.com/storage/dataset-schema.

✍️ Drafted by Claude Code

@apify-service-account apify-service-account added the t-tooling Issues with this label are in the ownership of the tooling team. label Jul 28, 2026
@vdusek vdusek mentioned this pull request Jul 28, 2026
@vdusek vdusek changed the title TODO fix: Make generated model fields that the API can omit as optional Jul 28, 2026
@vdusek vdusek changed the title fix: Make generated model fields that the API can omit as optional fix: Mark generated model fields that the API can omit as optional Jul 28, 2026
@vdusek

vdusek commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded - this PR no longer carries any changes.

Everything it contained has already landed on master through separate PRs: #923, #936, #941, #947, #960, #974. After merging master into this branch and resolving the _literals.py conflict, the resulting tree is byte-identical to master.

The conflict was a symptom of a workflow bug rather than a real spec change. The manual regeneration branch (update-models-manual) is reused indefinitely and never rebased onto master, so the second run checked out the 20-day-old branch tip and regenerated the models with the codegen tooling from that stale commit. That tooling predates #941, so _literals.py came out in the old closed Literal[...] form - merging this PR would have silently reverted the enum relaxation from #941.

The underlying issues in manual_regenerate_models.yaml will be addressed separately.

✍️ Drafted by Claude Code

@vdusek vdusek closed this Jul 28, 2026
@vdusek
vdusek deleted the update-models-manual branch July 28, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants