Skip to content

fix(openapi): Fix OpenAPI specification errors in /v2/acts#2288

Draft
Pijukatel wants to merge 2 commits intomasterfrom
fix/openapi/actors
Draft

fix(openapi): Fix OpenAPI specification errors in /v2/acts#2288
Pijukatel wants to merge 2 commits intomasterfrom
fix/openapi/actors

Conversation

@Pijukatel
Copy link
Contributor

@Pijukatel Pijukatel commented Feb 26, 2026

Summary

Fixes OpenAPI specification validation errors detected at runtime for the /v2/acts endpoints.

Validation errors being fixed

These are lines from the error log generated by the unmerged validator running on integration tests https://github.com/apify/apify-core/pull/26052:

WARN  Request OpenAPI validation error {"url":"/v2/acts/{id}/runs","errors":[{"message":"unsupported media type application/x-www-form-urlencoded","path":"/v2/acts/:actorId/runs"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}","errors":[{"message":"must be string,null","errorCode":"type.openapi.validation","path":"/response/data/taggedBuilds/latest/finishedAt"},{"message":"must be null","errorCode":"type.openapi.validation","path":"/response/data/taggedBuilds/latest"},{"message":"must match a schema in anyOf","errorCode":"anyOf.openapi.validation","path":"/response/data/taggedBuilds/latest"},{"message":"must be null","errorCode":"type.openapi.validation","path":"/response/data/taggedBuilds"},{"message":"must match a schema in anyOf","errorCode":"anyOf.openapi.validation","path":"/response/data/taggedBuilds"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/runs","errors":[{"message":"no schema defined for status code '403' in the openapi spec","path":"/v2/acts/{id}/runs"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/webhooks","errors":[{"message":"no schema defined for status code '403' in the openapi spec","path":"/v2/acts/{id}/webhooks"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}","errors":[{"message":"no schema defined for status code '404' in the openapi spec","path":"/v2/acts/{id}"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}","errors":[{"message":"no schema defined for status code '403' in the openapi spec","path":"/v2/acts/{id}"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/runs","errors":[{"message":"no schema defined for status code '402' in the openapi spec","path":"/v2/acts/{id}/runs"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/runs","errors":[{"message":"no schema defined for status code '401' in the openapi spec","path":"/v2/acts/{id}/runs"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/runs","errors":[{"message":"no schema defined for status code '404' in the openapi spec","path":"/v2/acts/{id}/runs"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts","errors":[{"message":"no schema defined for status code '401' in the openapi spec","path":"/v2/acts"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts","errors":[{"message":"no schema defined for status code '403' in the openapi spec","path":"/v2/acts"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/builds","errors":[{"message":"no schema defined for status code '401' in the openapi spec","path":"/v2/acts/{id}/builds"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/builds","errors":[{"message":"no schema defined for status code '403' in the openapi spec","path":"/v2/acts/{id}/builds"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/builds","errors":[{"message":"no schema defined for status code '404' in the openapi spec","path":"/v2/acts/{id}/builds"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/builds/default","errors":[{"message":"no schema defined for status code '401' in the openapi spec","path":"/v2/acts/{id}/builds/default"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/builds/default","errors":[{"message":"no schema defined for status code '403' in the openapi spec","path":"/v2/acts/{id}/builds/default"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/builds/default","errors":[{"message":"no schema defined for status code '404' in the openapi spec","path":"/v2/acts/{id}/builds/default"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/builds/{buildId}","errors":[{"message":"no schema defined for status code '401' in the openapi spec","path":"/v2/acts/{id}/builds/{buildId}"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/builds/{buildId}","errors":[{"message":"no schema defined for status code '403' in the openapi spec","path":"/v2/acts/{id}/builds/{buildId}"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/builds/{buildId}","errors":[{"message":"no schema defined for status code '404' in the openapi spec","path":"/v2/acts/{id}/builds/{buildId}"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/builds/{buildId}/openapi.json","errors":[{"message":"no schema defined for status code '401' in the openapi spec","path":"/v2/acts/{id}/builds/{buildId}/openapi.json"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/builds/{buildId}/openapi.json","errors":[{"message":"no schema defined for status code '403' in the openapi spec","path":"/v2/acts/{id}/builds/{buildId}/openapi.json"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/builds/{buildId}/openapi.json","errors":[{"message":"no schema defined for status code '404' in the openapi spec","path":"/v2/acts/{id}/builds/{buildId}/openapi.json"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/versions","errors":[{"message":"no schema defined for status code '401' in the openapi spec","path":"/v2/acts/{id}/versions"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/versions","errors":[{"message":"no schema defined for status code '403' in the openapi spec","path":"/v2/acts/{id}/versions"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/versions","errors":[{"message":"no schema defined for status code '404' in the openapi spec","path":"/v2/acts/{id}/versions"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/versions/{versionNumber}","errors":[{"message":"no schema defined for status code '401' in the openapi spec","path":"/v2/acts/{id}/versions/{versionNumber}"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/versions/{versionNumber}","errors":[{"message":"no schema defined for status code '403' in the openapi spec","path":"/v2/acts/{id}/versions/{versionNumber}"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/versions/{versionNumber}","errors":[{"message":"no schema defined for status code '404' in the openapi spec","path":"/v2/acts/{id}/versions/{versionNumber}"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/runs/last","errors":[{"message":"must have required property 'waitForFinish'","errorCode":"required.openapi.validation","path":"/query/waitForFinish"}]}
WARN  Request OpenAPI validation error {"url":"/v2/acts/{id}/run-sync","errors":[{"message":"unsupported media type application/x-www-form-urlencoded","path":"/v2/acts/:actorId/run-sync"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}/runs","errors":[{"message":"must have required property 'value'","errorCode":"required.openapi.validation","path":"/response/data/items/0/defaultRunOptions/envVars/0/value"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}","errors":[{"message":"must have required property 'format'","errorCode":"required.openapi.validation","path":"/response/data/versions/0/sourceFiles/0/format"}]}
WARN  Response OpenAPI validation error {"url":"/v2/acts/{id}","errors":[{"message":"must have required property 'folder'","errorCode":"required.openapi.validation","path":"/response/data/versions/0/sourceFiles/0/folder"}]}

Changes

New files: components/responses/Forbidden.yaml, PaymentRequired.yaml, UnsupportedMediaType.yaml

Added three new shared response components following the pattern of existing Unauthorized.yaml and NotFound.yaml:

  • Forbidden.yaml - 403, for permission-denied responses
  • PaymentRequired.yaml - 402, returned when the Actor requires a paid plan or the user has exceeded their limits
  • UnsupportedMediaType.yaml - 415, returned when an unsupported Content-Type is sent

components/schemas/actors/TaggedBuildInfo.yaml

Changed finishedAt from type: [string, "null"] to anyOf: [{type: string, format: date-time}, {type: "null"}]. The array-type notation combined with format: date-time caused the validator to apply the date-time format check against null values, triggering cascading taggedBuilds anyOf failures.

components/schemas/actors/EnvVar.yaml

  • Removed value from the required array - secret env vars do not return their value in API responses.
  • Changed value type from string to [string, "null"].

components/schemas/actors/SourceCodeFile.yaml

Removed format from the required array - not all source files include a format field.

components/schemas/actors/SourceCodeFolder.yaml

Removed folder from the required array - the anyOf union with SourceCodeFile was failing because each branch expected properties only present in the other.

components/schemas/actor-pricing-info/FlatPricePerMonthActorPricingInfo.yaml

Removed pricePerUnitUsd and trialMinutes from the required array - these fields are not always returned by the API for this pricing model.

components/schemas/actor-pricing-info/PayPerEventActorPricingInfo.yaml

Removed pricingPerEvent from the required array - not always returned by the API.

components/schemas/actor-pricing-info/PricePerDatasetItemActorPricingInfo.yaml

Removed pricePerUnitUsd and unitName from the required array - not always returned by the API.

components/schemas/actor-runs/Run.yaml

Changed buildNumber from type: string to type: [string, "null"] - runs that have not yet started building do not have a build number.

components/schemas/actor-runs/RunStats.yaml

Changed inputBodyLen from type: integer to type: [integer, "null"] - runs in progress may not have this stat populated yet.

paths/actors/acts.yaml - GET and POST /v2/acts

Added 401 and 403 responses to both operations.

paths/actors/acts@{actorId}.yaml - GET, PUT, DELETE /v2/acts/{actorId}

Added 401, 403, and 404 responses to all three operations.

paths/actors/acts@{actorId}@runs.yaml - GET and POST /v2/acts/{actorId}/runs

  • GET: Added 401, 403, 404 responses.
  • POST: Added 401, 402, 403, 404 responses. The 402 covers the case where the Actor requires a paid plan or the user has exceeded their subscription limits.

paths/actors/acts@{actorId}@runs@last.yaml - GET /v2/acts/{actorId}/runs/last

Added missing waitForFinish query parameter. The spec did not define it, causing request validation errors when clients passed it.

paths/actors/acts@{actorId}@run-sync.yaml - POST /v2/acts/{actorId}/run-sync

Added 415 response - returned when the request body uses an unsupported Content-Type.

paths/actors/acts@{actorId}@webhooks.yaml - GET /v2/acts/{actorId}/webhooks

Added 401, 403, 404 responses.

paths/actors/acts@{actorId}@builds.yaml - GET and POST /v2/acts/{actorId}/builds

Added 401, 403, 404 responses to both operations.

paths/actors/acts@{actorId}@builds@default.yaml - GET /v2/acts/{actorId}/builds/default

Added 401, 403, 404 responses.

paths/actors/acts@{actorId}@builds@{buildId}.yaml - GET /v2/acts/{actorId}/builds/{buildId}

Added 401, 403, 404 responses.

paths/actors/acts@{actorId}@builds@{buildId}@openapi.json.yaml - GET /v2/acts/{actorId}/builds/{buildId}/openapi.json

Added 401, 403, 404 responses.

paths/actors/acts@{actorId}@versions.yaml - GET and POST /v2/acts/{actorId}/versions

Added 401, 403, 404 responses to both operations.

paths/actors/acts@{actorId}@versions@{versionNumber}.yaml - GET, PUT, DELETE /v2/acts/{actorId}/versions/{versionNumber}

Added 401, 403, 404 responses to all three operations.

Issues

Partially implements: #2286

🤖 Generated with Claude Code

@github-actions github-actions bot added this to the 135th sprint - Tooling team milestone Feb 26, 2026
@github-actions github-actions bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Feb 26, 2026
@apify-service-account
Copy link

Preview for this PR was built for commit 07d2979 and is ready at https://pr-2288.preview.docs.apify.com!

Add missing response codes and fix schema issues for /v2/acts endpoints
based on method-specific validation errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@apify-service-account
Copy link

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

@Pijukatel Pijukatel changed the title fix: add missing response codes and fix schema issues in actors endpoints fix(openapi): add missing response codes and fix schema issues in actors endpoints Feb 27, 2026
@Pijukatel Pijukatel changed the title fix(openapi): add missing response codes and fix schema issues in actors endpoints fix(openapi): Fix OpenAPI specification errors in /v2/acts Feb 27, 2026
@Pijukatel Pijukatel changed the title fix(openapi): Fix OpenAPI specification errors in /v2/acts fix(openapi): Fix OpenAPI specification errors in /v2/acts Feb 27, 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