From 23a7fd2aa48f177569a3ff4170093c4863b0706a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hanu=C5=A1?= Date: Mon, 22 Jun 2026 01:34:46 +0200 Subject: [PATCH] fix: tighten actor.json version regex to match platform admission The `.version` pattern in `actor.schema.json` is currently looser than the platform's actual `MAJOR_MINOR_VERSION_REGEX` (in apify-core). External tooling that validates against this published schema (apify-cli project linting, IDE plugins, third-party SDKs, agent loops) gets a false-positive valid signal on 3-part SemVer like `1.0.0` and unbounded two-part values like `100.0`, only for the platform to reject them at the version-creation admission gate `POST /v2/acts/{id}/versions`. Changes: - `packages/json_schemas/schemas/actor.schema.json`: tighten pattern from `^([0-9]+)\.([0-9]+)(\.[0-9]+){0,1}$` (accepts 3-part SemVer and unbounded segments) to `^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$`, matching the platform's exact `MAJOR_MINOR_VERSION_REGEX` from apify-core/src/packages/simple-schema/src/regexs.ts:2 (each segment 0-99). After this lands, every downstream consumer (apify-cli, apify-worker, IDE extensions, etc.) fails-fast on invalid version strings at lint time instead of failing late at platform admission. Empirical confirmation of platform behavior (2026-06-21, throwaway Actor `vXEV76d7g0dyKXdPB`): `POST /v2/acts/{id}/versions` with `versionNumber: "1.0.0"` returns HTTP 400 schema-validation error. Refs: chocholous/apify-evals F36, F12, F22. --- packages/json_schemas/schemas/actor.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/json_schemas/schemas/actor.schema.json b/packages/json_schemas/schemas/actor.schema.json index 4cf7d1a2..1c1aa134 100644 --- a/packages/json_schemas/schemas/actor.schema.json +++ b/packages/json_schemas/schemas/actor.schema.json @@ -22,7 +22,7 @@ }, "version": { "type": "string", - "pattern": "^([0-9]+)\\.([0-9]+)(\\.[0-9]+){0,1}$" + "pattern": "^([0-9]|[1-9][0-9])\\.([0-9]|[1-9][0-9])$" }, "buildTag": { "type": "string",