Skip to content

fix: Preserve Actor input-schema validation keywords - #1186

Open
Ayush7614 wants to merge 1 commit into
apify:masterfrom
Ayush7614:fix/preserve-actor-schema-constraints
Open

fix: Preserve Actor input-schema validation keywords#1186
Ayush7614 wants to merge 1 commit into
apify:masterfrom
Ayush7614:fix/preserve-actor-schema-constraints

Conversation

@Ayush7614

@Ayush7614 Ayush7614 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Keep Actor-declared JSON Schema validation keywords (minimum, maximum, minLength, maxLength, minItems, maxItems, exclusive bounds, uniqueItems, pattern) through filterSchemaProperties.
  • Only emit keys whose upstream value is defined — no more phantom default: undefined on every property.
  • Extend SchemaProperties so the type matches what AJV and tools/list actually need.

Why

filterSchemaProperties whitelisted only title/description/enum/type/default/prefill/properties/items/required. Real Actor schemas declare bounds (e.g. maxResults maximum: 100), but MCP-side AJV never saw them, so out-of-range inputs reached Apify runs and failed late. Agents also never saw those constraints in tools/list.

Test plan

  • pnpm run type-check
  • pnpm run lint
  • pnpm run test:unit (new filter + AJV enforcement cases; updated transform assertions)
  • pnpm run format / pnpm run check:agents
  • Spot-check tools/list for an Actor with maximum/minLength and confirm bounds appear

filterSchemaProperties dropped minimum/maximum/minLength and related bounds, so AJV and tools/list never enforced Actor-declared limits. Only emit defined keys.
@Ayush7614
Ayush7614 force-pushed the fix/preserve-actor-schema-constraints branch 2 times, most recently from 878c1e8 to b3270c6 Compare July 30, 2026 15:48
@jirispilka
jirispilka requested review from RobertCrupa and jirispilka and removed request for jirispilka July 31, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants