fix(schema): make account.supported_billing conditional on media_buy protocol#3750
Merged
bokelley merged 1 commit intoMay 11, 2026
Merged
Conversation
…protocol Removes unconditional `required: ["supported_billing"]` from the `account` object definition and replaces it with a root-level `allOf` `if/then` constraint: `supported_billing` (and `account` itself) is required only when `media_buy` is in `supported_protocols`. The schema description already stated "Expected when media_buy is in supported_protocols" — this aligns enforcement with documented intent. Non-breaking: relaxes the constraint for non-media-buy agents (signals, creative, governance, brand, SI); preserves it for media-buy agents via the `then` branch. Any conformant 3.0 implementation already satisfies the new MUST. Note: draft-07 `if/then` is dropped by some code generators (openapi-typescript, zod-to-json-schema, quicktype). SDK generator targets should treat `supported_billing` as required when `media_buy` is declared and `account` is present. Closes #3746 Session: https://claude.ai/code/session_01VE9kbAjX6nAmAruFXbUeka
ef3d177 to
4783430
Compare
Merged
2 tasks
bokelley
pushed a commit
that referenced
this pull request
May 13, 2026
…ture The composed-schema-validation test for the adcp.idempotency oneOf discriminator constructs a `capabilitiesBase` fixture declaring `supported_protocols: ['media_buy']`. Since #3750 made `account.supported_billing` conditional-required on `media_buy`, the fixture itself fails the schema — the IdempotencySupported and IdempotencyUnsupported positive-case assertions both error with "must have required property 'account'". This failure was masked while test:json-schema was red (npm chained the test steps with &&); fixing the doc-block examples in this PR's earlier commit surfaces it. Same fix shape — add the canonical `{ supported_billing: ['operator', 'agent'] }` block. Verified: npm run test:schemas / test:json-schema / test:extension-schemas / test:composed all pass locally.
bokelley
pushed a commit
that referenced
this pull request
May 13, 2026
…es (unblocks 3.0.x CI) (#4483) * docs(capabilities): add account.supported_billing to media_buy examples #3750 made `account.supported_billing` conditionally required on `get_adcp_capabilities_response` whenever `supported_protocols` contains `media_buy`. Four illustrative example blocks in the docs were not updated alongside the schema and have since been failing the docs schema-validation step on every `3.0.x` PR, blocking the branch. Each affected example now declares `account.supported_billing` with `["operator", "agent"]`, matching the established pattern in `docs/building/integration/accounts-and-agents.mdx`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * test(composed): add account.supported_billing to capabilitiesBase fixture The composed-schema-validation test for the adcp.idempotency oneOf discriminator constructs a `capabilitiesBase` fixture declaring `supported_protocols: ['media_buy']`. Since #3750 made `account.supported_billing` conditional-required on `media_buy`, the fixture itself fails the schema — the IdempotencySupported and IdempotencyUnsupported positive-case assertions both error with "must have required property 'account'". This failure was masked while test:json-schema was red (npm chained the test steps with &&); fixing the doc-block examples in this PR's earlier commit surfaces it. Same fix shape — add the canonical `{ supported_billing: ['operator', 'agent'] }` block. Verified: npm run test:schemas / test:json-schema / test:extension-schemas / test:composed all pass locally. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Brian O'Kelley <brian@agenticadvertising.org>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3746
Summary
The
get_adcp_capabilitiesresponse schema requiredaccount.supported_billingunconditionally for all agents, even those that don't declaremedia_buyinsupported_protocols. The field has no semantics outside of media buying (operator-pays / advertiser-pays arrangements), and the schema's own description already stated "Expected when media_buy is in supported_protocols." This mismatch caused every non-media-buy agent (signals, creative, governance, brand, SI, measurement) that included anaccountblock to fail schema validation on a single irrelevant field, which cascades into SDK v2-downgrade loops and storyboard failures across the board.Changes:
"required": ["supported_billing"]from theaccountobject definition — it was enforced unconditionally on any agent that included anaccountblock.allOfif/thenconstraint:accountandaccount.supported_billingare required only whensupported_protocolscontains"media_buy". Uses the samecontains: { const: "..." }+required: [...]guard pattern asgovernance/sync-plans-request.json.account.descriptionto surface the conditional rule at first read.media_buy.descriptionfrom "should include" to "MUST include" — theif/thennow normatively enforces it.Non-breaking justification: Relaxes a constraint for non-media-buy agents (they may now omit
supported_billingfrom anaccountblock without failing validation). Preserves the constraint for media-buy agents via thethenbranch. Any conformant 3.0.0 media-buy implementation already satisfies the new MUST — the description established the expectation; the schema constraint now aligns with it.Code-generator note: draft-07
if/thenis dropped by openapi-typescript, zod-to-json-schema, datamodel-code-generator pre-0.25, and quicktype. SDK generator targets should add a runtime guard requiringsupported_billingwhenmedia_buyis declared andaccountis present. (The same caveat already applies toadcp.idempotency'soneOfin this schema per its existing inline comment.)Pre-PR review
allOfplacement correct,then.properties.account.requiredcorrectly overlays rootaccountdefinition; redundantrequired: ["supported_protocols"]guard insideifis harmless (root-levelrequiredalready enforces it);patchchangeset level correct.then.properties.accounttype guard technically redundant given root-level"type": "object"onaccount(and the established repo pattern insync-plans-request.jsondoesn't add type guards either); description nits addressed in this diff.Session: https://claude.ai/code/session_01VE9kbAjX6nAmAruFXbUeka
Generated by Claude Code