Skip to content

fix(openapi): relax required fields on actor pricing info schemas#2584

Closed
vdusek wants to merge 1 commit into
masterfrom
feat/optional-actor-pricing-info-fields
Closed

fix(openapi): relax required fields on actor pricing info schemas#2584
vdusek wants to merge 1 commit into
masterfrom
feat/optional-actor-pricing-info-fields

Conversation

@vdusek
Copy link
Copy Markdown
Contributor

@vdusek vdusek commented May 28, 2026

The platform-set APIFY_ACTOR_PRICING_INFO env var omits apifyMarginPercentage, createdAt, startedAt and eventDescription, so consumers deserializing it via the generated pydantic models hit validation errors and resort to injecting placeholder defaults. Marking these optional matches reality and is consistent with the sibling CurrentPricingInfo schema, which already has these fields optional.

Triggers a pydantic model regeneration in apify-client-python; once merged, the SDK can drop the placeholder-injection workaround in _normalize_actor_pricing_info.

Drop `apifyMarginPercentage`, `createdAt`, `startedAt` from `CommonActorPricingInfo`
and `eventDescription` from `ActorChargeEvent`. The platform-set
`APIFY_ACTOR_PRICING_INFO` env var omits these fields, so consumers
deserializing it via the generated pydantic models hit avoidable
validation errors and resort to injecting placeholder defaults. Marking
them optional matches reality and is consistent with the sibling
`CurrentPricingInfo` schema, which already has these fields optional.
@vdusek vdusek requested review from fnesveda and janbuchar as code owners May 28, 2026 10:34
@github-actions github-actions Bot added this to the 141st sprint - Tooling team milestone May 28, 2026
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label May 28, 2026
@apify-service-account
Copy link
Copy Markdown
Contributor

apify-service-account commented May 28, 2026

🗑️ Preview for this PR was deleted.

@apify-service-account
Copy link
Copy Markdown
Contributor

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#832

  • 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
Copy link
Copy Markdown
Contributor Author

vdusek commented May 28, 2026

Closing - these fields are written into Actor env vars by the worker, which strips them before serializing. The API itself always returns them, so the schema should stay as-is (and we should create custom models in the SDK instead).

@vdusek vdusek closed this May 28, 2026
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