Skip to content

create-media-buy submitted-branch schema underspecified — missing required status + task_id #4077

@bokelley

Description

@bokelley

What

schemas/cache/media-buy/create-media-buy-async-response-submitted.json (the submitted-branch schema referenced by create-media-buy-response.json's 3-branch anyOf) currently only lists context and ext in properties and describes itself as "usually empty or just context."

The main create-media-buy-response.json Branch 3 requires status: const "submitted" + task_id (string) — that's the AdCP async-task contract: a buyer needs a polling handle.

Impact

When a platform implementation forgets task_id in the submitted envelope, the SDK's per-tool output validator (FastMCP / jsonschema) surfaces a misleading error. jsonschema's deepest-schema-path heuristic picks the enum violation on status inside the success branch (depth 7) over the required: task_id violation in the submitted branch (depth 3). The reported error reads:

Output validation error: 'submitted' is not one of ['pending_creatives', 'pending_start', 'active', 'paused', 'completed', 'rejected', 'canceled']

…which sends implementors hunting in the wrong direction. Verified empirically with jsonschema on the union schema: adding task_id to the same payload validates cleanly.

If the submitted-branch schema itself enumerated status (const) and required task_id, the SDK's opt-in validate_response() (which routes on status="submitted" and validates against this file) would catch the missing task_id with a clear, branch-local message instead of letting it propagate to the union validator's misleading deepest-error pick.

Proposed change

In static/schemas/v1/media-buy/create-media-buy-async-response-submitted.json:

{
  "properties": {
    "status": { "const": "submitted" },
    "task_id": { "type": "string", "description": "Polling handle for the async task" },
    "context": { ... existing ... },
    "ext": { ... existing ... }
  },
  "required": ["status", "task_id"]
}

(Adjust to match the spec repo's actual file location and existing structure.)

Surfaced by

adcp-client-python issue #570 — salesagent live GAM CRUD probe. The SDK side has been addressed in adcp-client-python#575 (return-type + alias) but the underlying schema gap is upstream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    claude-triagedIssue has been triaged by the Claude Code triage routine. Remove to re-triage.media-buyIssue concerns the media-buy protocol domainschemaJSON Schema source-of-truth: definitions, codegen artifacts, validation, hygiene

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions