Skip to content

codegen: 6.6.0 ListCreativeFormatsRequest drops spec-defined 'type' filter and 'uniqueItems' constraints #971

Closed

Description

@numarasSigmaSoftware

The authoritative AdCP 3.1.1 list-creative-formats-request.json schema defines:

  • type — enum [audio, video, display, dooh]
  • disclosure_positions — uniqueItems: true
  • disclosure_persistence — uniqueItems: true

The generated Python model in adcp-client-python==6.6.0 omits the type field and the uniqueItems validations, so a client cannot send the type filter and duplicate disclosure_positions / disclosure_persistence entries aren't rejected.

Repro: inspect the generated ListCreativeFormatsRequest model in 6.6.0.
Expected: type field + uniqueItems validation present, per the 3.1.1 schema.
Actual: absent.

Impact: downstream servers pinning 6.6.0 cannot honor these spec-defined filters/constraints and must suppress the corresponding conformance scenarios until codegen is fixed.

Activity

  1. added
    claude-triagingTriage routine is actively working on this issue (1-3 min)
    on Jul 16, 2026
  2. bokelley commented on Jul 16, 2026

    @bokelley
    Contributor

    Triage

    Thanks for filing!

    Classification: Bug (partial — one of two claims confirmed)
    Bucket(s): validation (no matching label in repo — noted in run summary)
    Status: ready-to-implement

    What the experts said:

    • ad-tech-protocol-expert: type omission is intentional — the media-buy and creative schemas are distinct role boundaries in AdCP 3.1; the uniqueItems gap is a real codegen omission affecting both generated models; fix belongs in _ergonomic.py via BeforeValidator.
    • code-reviewer: type claim is a misidentified bug (reporter referenced the creative schema, not the media-buy one); uniqueItems confirmed on both models; coerce_to_unique_enum_list in scripts/generate_ergonomic_coercion.py is the correct fix layer.

    My take: The type field (audio | video | display | dooh) is intentionally absent from ListCreativeFormatsRequest — it lives in ListCreativeFormatsRequestCreativeAgent, which is generated from the creative-agent schema. The uniqueItems gap is real: both source JSON schemas define uniqueItems: true for disclosure_positions and disclosure_persistence, but datamodel-code-generator silently drops it.

    Implementation scope:

    • Add coerce_to_unique_enum_list (order-preserving dedup via dict.fromkeys) to src/adcp/types/coercion.py.
    • Update scripts/generate_ergonomic_coercion.py to use it for disclosure_positions and disclosure_persistence on both ListCreativeFormatsRequest (media-buy) and ListCreativeFormatsRequestCreativeAgent (creative); regenerate src/adcp/types/_ergonomic.py.
    • Add test cases in tests/test_type_coercion.py asserting duplicate enum values on both fields are silently deduplicated.
    • Non-breaking: silent dedup preserves all valid callers; duplicates were always spec-violating per uniqueItems: true in the source schemas. No action needed on type.
    • Run: pytest tests/test_type_coercion.py, mypy src/, ruff check .

    Triaged by Claude Code. Session: https://claude.ai/code/session_019f2K7fyr3Me24q4MZpB4A3


    Generated by Claude Code

  3. added
    bugSomething isn't working
    and removed
    claude-triagingTriage routine is actively working on this issue (1-3 min)
    on Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions