Skip to content

fix(openapi): align Actor pricing and version schemas with live API#2555

Merged
vdusek merged 3 commits into
masterfrom
fix/openapi-tiered-pricing-and-version
May 22, 2026
Merged

fix(openapi): align Actor pricing and version schemas with live API#2555
vdusek merged 3 commits into
masterfrom
fix/openapi-tiered-pricing-and-version

Conversation

@vdusek
Copy link
Copy Markdown
Contributor

@vdusek vdusek commented May 21, 2026

The Pydantic models generated from this spec in apify-client-python reject real responses from GET /v2/acts/{id} and GET /v2/acts/{id}/builds/default (see apify/apify-client-python#811). Three schema mismatches with the live API:

  1. PricePerDatasetItemActorPricingInfo required pricePerUnitUsd, but Actors using tiered PPR pricing return tieredPricing instead.
  2. ActorChargeEvent required eventPriceUsd, but tiered PPE events return eventTieredPricingUsd. The fields isPrimaryEvent and isOneTimeEvent were also missing.
  3. ActorDefinition.version pattern ^[0-9]+\.[0-9]+$ rejected semver-style triplets like 0.0.1 that real actors return.

Pydantic models generated from the spec reject real responses from
`GET /v2/acts/{id}` and `GET /v2/acts/{id}/builds/default` because the
schemas don't model tiered pricing and use an overly strict version
pattern. Make `pricePerUnitUsd` / `eventPriceUsd` optional, add
`tieredPricing` / `eventTieredPricingUsd` (plus `isPrimaryEvent` and
`isOneTimeEvent`), add common pricing-info flags returned by the API,
and relax the actor `version` pattern to accept multi-segment values
like `0.0.1`. Fixes apify/apify-client-python#811.
@vdusek vdusek requested review from fnesveda and janbuchar as code owners May 21, 2026 18:16
@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 May 21, 2026
@vdusek vdusek self-assigned this May 21, 2026
@github-actions github-actions Bot added this to the 141st sprint - Tooling team milestone May 21, 2026
@apify-service-account
Copy link
Copy Markdown
Contributor

apify-service-account commented May 21, 2026

🗑️ Preview for this PR was deleted.

@apify-service-account
Copy link
Copy Markdown
Contributor

Python client model regeneration failed. See workflow run.

Copy link
Copy Markdown
Member

@fnesveda fnesveda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, except the Actor version number changes, those are not correct. The three-number strings are build numbers, never versions.

Comment thread apify-api/openapi/components/schemas/actors/ActorDefinition.yaml
@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#817

  • 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 merged commit 01bc485 into master May 22, 2026
16 checks passed
@vdusek vdusek deleted the fix/openapi-tiered-pricing-and-version branch May 22, 2026 12:03
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.

4 participants