You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(codegen): lock deprecation-decorator generation on deprecated JSON Schema properties #778
Filed in response to adcontextprotocol/adcp#4904 (the 3.1 additive-deprecate on `CreateMediaBuySuccess` / `UpdateMediaBuySuccess` body-level `status`). The expert review on that PR flagged that JSON Schema `deprecated: true` propagation through codegen is partially reliable across Python toolchains; the storyboard certification gate is doing the real enforcement work but the SDK side should lock its part of the contract.
What's needed
A unit test that asserts a deprecation surface (typically `deprecated=True` on `pydantic.Field(...)` for Pydantic v2, or a `warnings.warn`-style decorator on field accessors) is emitted on Python types regenerated from AdCP schemas where the source schema declares `deprecated: true` on a property.
Anchor case: `CreateMediaBuySuccess.status` and `UpdateMediaBuySuccess.status` in AdCP 3.1+. Both fields are marked `deprecated: true` (description-level + the JSON Schema 2020-12 `deprecated` keyword) on the source schema.
The test should:
Regen types from the schema set that contains these properties (latest AdCP schemas).
Inspect the generated model (e.g., via Pydantic's `model_fields` and the field's `json_schema_extra` or `deprecated` attribute).
Assert that the `status` member on `CreateMediaBuySuccess` and `UpdateMediaBuySuccess` carries the deprecation marker.
Why the toolchain matters
The protocol-side expert review flagged `datamodel-code-generator` (a common JSON-Schema-to-Pydantic generator) as having uneven deprecation-keyword support — emits the marker only on v2+ recent releases; older pinned versions silently drop it. If `adcp-client-python` uses `datamodel-code-generator` or a similar tool, the version pin matters; if the test asserts deprecation surfaces in the generated output, regressions get caught at CI rather than in production.
This locks the contract that the JSON Schema deprecation marker continues to surface in generated types as the field rotates through 3.1 (additive) → 3.2 (legacy removal) → 4.0 (nested cascade renames).
Classification: Feature request (new test) Bucket(s): validation Status: drafting-pr Milestone: omitted — test-only change, no version target specified
What the experts said:
code-reviewer: approved — 2 nits fixed (duplicate docstring bullet, pending import path corrected to public adcp.types)
ad-tech-protocol-expert: approved after blocker fixed — corrected an inaccurate comment claiming one assertion covered all four bundled schema occurrences; public TargetingOverlay resolves to the core schema class, not the structurally identical bundled variants
My take: The codegen pin already emits deprecated=True correctly for the current 3.0.7 schema bundle; the test locks that contract so a silent pin bump or schema refresh can't regress it undetected. The 3.1 anchor cases (CreateMediaBuySuccessResponse.status, UpdateMediaBuySuccessResponse.status) are documented as a commented-out block ready to activate when adcp#4904 schema sync lands.
Housekeeping: closed stale draft PR #781 as deferred. The underlying contract remains valid, but #781 only pinned older 3.0.7 deprecated fields and left the real 3.1 anchor cases commented out. Recommendation: keep this issue open and re-cut after the 3.1 schema/codegen cleanup lands, using CreateMediaBuySuccessResponse.status and UpdateMediaBuySuccessResponse.status as live assertions.
Activity
bokelley commentedon May 21, 2026
Triage
Classification: Feature request (new test)
Bucket(s): validation
Status: drafting-pr
Milestone: omitted — test-only change, no version target specified
What the experts said:
adcp.types)TargetingOverlayresolves to the core schema class, not the structurally identical bundled variantsMy take: The codegen pin already emits
deprecated=Truecorrectly for the current 3.0.7 schema bundle; the test locks that contract so a silent pin bump or schema refresh can't regress it undetected. The 3.1 anchor cases (CreateMediaBuySuccessResponse.status,UpdateMediaBuySuccessResponse.status) are documented as a commented-out block ready to activate when adcp#4904 schema sync lands.Draft PR: #781
Triaged by Claude Code. Session: https://claude.ai/code/session_0169cPJV4qE4hxoLvkJsm2mg
Generated by Claude Code
bokelley commentedon May 23, 2026
Housekeeping: closed stale draft PR #781 as deferred. The underlying contract remains valid, but #781 only pinned older 3.0.7 deprecated fields and left the real 3.1 anchor cases commented out. Recommendation: keep this issue open and re-cut after the 3.1 schema/codegen cleanup lands, using CreateMediaBuySuccessResponse.status and UpdateMediaBuySuccessResponse.status as live assertions.
test: lock JSON-Schema deprecation propagation contract (#936)