Skip to content

docs(dataset-schema): distinguish top-level fields from views.*.transformation.fields#2733

Draft
DaveHanns wants to merge 1 commit into
masterfrom
docs-dataset-schema-two-fields-keys
Draft

docs(dataset-schema): distinguish top-level fields from views.*.transformation.fields#2733
DaveHanns wants to merge 1 commit into
masterfrom
docs-dataset-schema-two-fields-keys

Conversation

@DaveHanns

Copy link
Copy Markdown
Contributor

Summary

The Dataset schema specification page defines two different keys named fields, but does not contrast them explicitly:

  • Top-level fields — a JSON Schema object keyed by field name (under properties). Drives server-side validation, MCP schema discovery for AI agents, and the documented API contract.
  • views.<viewId>.transformation.fields — a flat array of field name strings. Selects which columns appear in the Console Output tab and their order. Display-only.

Because the two keys share a name and the page introduces them in separate sections, it is easy to populate only the view-level array. Console then still renders the selected columns, so the mistake looks harmless — but validation, the MCP schema, and the API metadata have no schema to work from.

What this PR changes

Adds a short ### The two \fields` keyssubsection under## Schema components`. The subsection:

  • Names both locations and tables their type and purpose side by side.
  • Calls out the common mistake (populating only the view-level array).
  • Links back to the top-of-page example (which already populates both) and forward to the fuller ## Fields example.

No content is removed; the existing structure is unchanged.

Reproducer for the confusion

Following the page in order, a reader hits the views.*.transformation.fields array before reaching the top-level fields section, and often writes only the view-level array. For example:

{
    "actorSpecification": 1,
    "views": {
        "overview": {
            "title": "Overview",
            "transformation": { "fields": ["title", "price"] },
            "display": { "component": "table" }
        }
    }
}

This validates and renders in Console, but the Actor exposes no field-level schema for validation, the MCP server, or the API contract that downstream agents rely on. The intended shape has both keys populated (as in the page's own top-of-file example), and the new subsection makes that requirement explicit up front.

Test plan

  • Read the updated page top to bottom — the distinction between the two fields locations is clear after one pass.
  • The top-of-page example under ## Schema components still shows both keys populated (unchanged), and the new subsection references it.
  • pnpm start renders the new subsection with the table formatted correctly and the two intra-page links resolving.

Surfaced during an evaluation of Apify surfaces for agent-driven Actor development.

…ansformation.fields`

The Dataset schema specification page defines two keys named `fields` — the
top-level JSON Schema object and the flat array under
`views.<viewId>.transformation.fields`. They live in different places and do
different jobs, but the page does not contrast them explicitly, and readers
regularly populate only the view-level array. When they do, Console still
renders the selected columns, but validation and the MCP / API schema have
nothing to work from.

Add a short subsection under "Schema components" that names both locations,
tables their type and purpose side by side, calls out the common mistake, and
links to the fuller example lower on the page.

Surfaced during an evaluation of Apify surfaces for agent-driven Actor
development.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@apify-service-account

apify-service-account commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

✅ Preview for this PR (commit d1bebf2) is ready at https://pr-2733.preview.docs.apify.com (see action run).

@DaveHanns DaveHanns marked this pull request as draft July 5, 2026 11:21
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