Skip to content

fix: empty templates ship input_schema.json and reference it from actor.json#819

Draft
DaveHanns wants to merge 1 commit into
masterfrom
fix/f40-empty-templates-ship-input-schema
Draft

fix: empty templates ship input_schema.json and reference it from actor.json#819
DaveHanns wants to merge 1 commit into
masterfrom
fix/f40-empty-templates-ship-input-schema

Conversation

@DaveHanns

@DaveHanns DaveHanns commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Empty templates (ts-empty, js-empty, python-empty) were the only common scaffolding starting points that did not ship a .actor/input_schema.json — and their actor.json didn't carry a .input reference either. Agents extrapolating from these templates produce Actors that rely on the platform's deprecated auto-discovery fallback (see apify-docs input_schema/specification.md line 21).

This PR brings them into line with the start templates (which already ship both files + the linkage) and updates the shared agent-bases/{ts,js,python}.AGENTS.md files so the explicit-reference pattern is taught in the docs that propagate to every per-template AGENTS.md.

Scope

Change Files
New .actor/input_schema.json starter file templates/{ts,js,python}-empty/.actor/input_schema.json (3 new)
.actor/actor.json gains "input": "./input_schema.json" templates/{ts,js,python}-empty/.actor/actor.json (3 modified)
agent-bases/{ts,js,python}.AGENTS.md — Do-list bullet + project-tree annotation 3 modified
Total 9 files (3 new, 6 modified)

Per the README: agent-bases/<lang>.AGENTS.md files propagate to every per-template AGENTS.md via CI, so the 3 base edits lift every template.

Starter input_schema.json content

Each empty template ships:

{
    "$schema": "https://apify.com/schemas/v1/input.ide.json",
    "title": "Actor Input",
    "type": "object",
    "schemaVersion": 1,
    "properties": {
        "example": {
            "title": "Example Field",
            "type": "string",
            "description": "Replace this with your actual input fields.",
            "editor": "textfield"
        }
    },
    "required": []
}

Single placeholder field, no required fields, lowest-friction for agents/users to replace with the real schema.

AGENTS.md changes (applied to all 3 shared bases)

 - set sensible defaults in `.actor/input_schema.json` for all optional fields
+- explicitly reference the input schema from `.actor/actor.json` by adding `"input": "./input_schema.json"` — do not rely on auto-discovery, which is deprecated

Plus the project-structure tree now reads:

.actor/
├── actor.json # Actor config: name, version, env vars, runtime settings, input schema reference
├── input_schema.json # Input validation & Console form definition (referenced from actor.json via "input")
└── output_schema.json # Specifies where an Actor stores its output

Test plan

  • CI green (template archives rebuild via the dist/templates/*.zip action)
  • apify create -t ts-empty produces a scaffold that includes both .actor/input_schema.json AND .input reference in actor.json
  • Same for js-empty and python-empty
  • Per-template AGENTS.md files are auto-updated by the CI propagation workflow

Refs

🤖 Generated with Claude Code

…or.json

Empty templates (ts-empty, js-empty, python-empty) were the only common
scaffolding starting points that did not ship a `.actor/input_schema.json`.
Agents using these templates would create the schema file themselves but
omit the `.input` reference in `.actor/actor.json`, relying on the
deprecated auto-discovery fallback.

## What changed

### `agent-bases/{ts,js,python}.AGENTS.md` (the shared bases that
propagate into every per-template AGENTS.md via CI)

- **Do list (line 28-29 in each)**: added a new bullet right after the
  existing "set sensible defaults in `.actor/input_schema.json`"
  bullet:
    > explicitly reference the input schema from `.actor/actor.json` by
    > adding `"input": "./input_schema.json"` — do not rely on
    > auto-discovery, which is deprecated
- **Project structure tree**: updated `actor.json` and
  `input_schema.json` annotations so the linkage is visible at a
  glance.

### `templates/{ts,js,python}-empty/.actor/actor.json`

- Added `"input": "./input_schema.json"` between the `meta` block and
  the `dockerfile` field. Preserves all other content + 4-space
  indentation.

### `templates/{ts,js,python}-empty/.actor/input_schema.json` (new
file in each)

- Ships a minimal starter schema with a single `example` string field
  (described as "Replace this with your actual input fields"). Mirrors
  the `python-start` / `ts-start` pattern of shipping a working schema
  the user replaces. Agents see the linkage live and produce
  `.input`-referenced schemas by default.

## Rationale

The "start" templates already ship both `.actor/input_schema.json` and
the `.input` reference in `actor.json`. The "empty" templates were the
outlier, leaving agents without a live example to crib from. Bringing
them into line + adding the explicit AGENTS.md instruction closes the
loop from both directions: the scaffold demonstrates the pattern, and
the agent docs reinforce it.

Refs: chocholous/apify-evals F40.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-dx Issues owned by the DX team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants