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).
Related
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:
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).
Related
status(TaskStatus) collides with payloadstatus(MediaBuyStatus) at the same top-level key on create/update/cancel_media_buy adcp#4895 — issue driving the 3.1 additive-deprecatestatuson CreateMediaBuySuccess / UpdateMediaBuySuccess (3.2) adcp#4906 — 3.2 follow-up that removes the deprecated fieldstatustomedia_buy_statuson get_media_buys / get_media_buy_delivery / core/media-buy adcp#4905 — 4.0 nested cascade@deprecatedJSDoc generation on deprecated JSON Schema properties adcp-client#1915 — TypeScript SDK equivalent