|
1 | 1 | # Changelog |
2 | 2 |
|
3 | | -## [2.0.0] - 2025-11-15 |
4 | | - |
5 | | -### ⚠️ BREAKING CHANGES |
6 | | - |
7 | | -#### Migration to datamodel-code-generator |
8 | | - |
9 | | -This release completes the migration from custom type generation to the industry-standard `datamodel-code-generator` tool. This brings improved type safety, better Pydantic v2 support, and alignment with JSON Schema specifications. |
10 | | - |
11 | | -**Breaking Changes:** |
12 | | - |
13 | | -1. **Dictionary access no longer supported** - All generated types are now proper Pydantic models, not TypedDicts |
14 | | - - ❌ **OLD**: `format.assets_required[0]["asset_id"]` |
15 | | - - ✅ **NEW**: `format.assets_required[0].asset_id` |
16 | | - - This affects ALL nested objects throughout the SDK (assets, deployments, destinations, etc.) |
17 | | - |
18 | | -2. **Backward compatibility aliases removed** - The 23 type aliases introduced in v1.6.x have been removed |
19 | | - - Use numbered discriminated union variants directly (e.g., `Destination1`, `Destination2` instead of `PlatformDestination`, `AgentDestination`) |
20 | | - - Or import from discriminated union types (e.g., `Destination`) |
21 | | - - See migration guide below for full list |
22 | | - |
23 | | -3. **Simplified main module exports** - The main `adcp` module no longer re-exports all generated types |
24 | | - - ✅ **NEW**: Import from `adcp.types.generated` directly: `from adcp.types.generated import Product, Format, etc.` |
25 | | - - Or access via module: `from adcp.types import generated; generated.Product` |
26 | | - |
27 | | -**Removed Type Aliases:** |
28 | | - |
29 | | -- `ActivateSignalSuccess` / `ActivateSignalError` → Use `ActivateSignalResponse1` / `ActivateSignalResponse2` |
30 | | -- `CreateMediaBuySuccess` / `CreateMediaBuyError` → Use `CreateMediaBuyResponse1` / `CreateMediaBuyResponse2` |
31 | | -- `UpdateMediaBuySuccess` / `UpdateMediaBuyError` → Use `UpdateMediaBuyResponse1` / `UpdateMediaBuyResponse2` |
32 | | -- `SyncCreativesSuccess` / `SyncCreativesError` → Use `SyncCreativesResponse1` / `SyncCreativesResponse2` |
33 | | -- `PlatformDestination` / `AgentDestination` → Use `Destination1` / `Destination2` |
34 | | -- `PlatformDeployment` / `AgentDeployment` → Use `Deployment1` / `Deployment2` |
35 | | -- `Segment_idActivationKey` / `Key_valueActivationKey` → Use `ActivationKey1` / `ActivationKey2` |
36 | | -- `UrlVastAsset` / `InlineVastAsset` → Use `VastAsset1` / `VastAsset2` |
37 | | -- `UrlDaastAsset` / `InlineDaastAsset` → Use `DaastAsset1` / `DaastAsset2` |
38 | | -- `MediaSubAsset` / `TextSubAsset` → Use `SubAsset1` / `SubAsset2` |
39 | | -- `UrlPreviewRender` / `HtmlPreviewRender` / `BothPreviewRender` → Use `PreviewRender1` / `PreviewRender2` / `PreviewRender3` |
40 | | -- `ListCreativeFormatsRequest` / `ListCreativeFormatsResponse` → Use `ListCreativeFormatsRequestCreativeAgent` / `ListCreativeFormatsResponseCreativeAgent` |
41 | | - |
42 | | -### Features |
43 | | - |
44 | | -* **Runtime Validation** - Added validation utilities for constraints not enforced by upstream JSON schemas: |
45 | | - - `validate_adagents()` - Validates mutual exclusivity in adagents.json authorization fields |
46 | | - - `validate_product()` - Validates publisher_properties mutual exclusivity |
47 | | - - `validate_agent_authorization()` - Validates agent authorization field constraints |
48 | | - - `validate_publisher_properties_item()` - Validates property_ids/property_tags mutual exclusivity |
49 | | - - These validators are automatically applied by `fetch_adagents()` but can also be used standalone |
50 | | - |
51 | | -* **Schema Validation Gap Documentation** - Added `SCHEMA_VALIDATION_GAPS.md` documenting upstream schema issues where mutual exclusivity is documented but not enforced |
52 | | - |
53 | | -### Migration Guide |
54 | | - |
55 | | -**Update dictionary access to attribute access:** |
56 | | - |
57 | | -```python |
58 | | -# Before (v1.x) |
59 | | -asset_id = format.assets_required[0]["asset_id"] |
60 | | -deployment = signal["deployments"][0]["platform"] |
61 | | - |
62 | | -# After (v2.0) |
63 | | -asset_id = format.assets_required[0].asset_id |
64 | | -deployment = signal.deployments[0].platform |
65 | | -``` |
66 | | - |
67 | | -**Update type imports:** |
68 | | - |
69 | | -```python |
70 | | -# Before (v1.x) |
71 | | -from adcp import ( |
72 | | - ActivateSignalSuccess, |
73 | | - ActivateSignalError, |
74 | | - PlatformDestination, |
75 | | - AgentDestination, |
76 | | -) |
77 | | - |
78 | | -# After (v2.0) - Option 1: Use numbered variants |
79 | | -from adcp.types.generated import ( |
80 | | - ActivateSignalResponse1, # Success |
81 | | - ActivateSignalResponse2, # Error |
82 | | - Destination1, # Platform |
83 | | - Destination2, # Agent |
84 | | -) |
85 | | - |
86 | | -# After (v2.0) - Option 2: Use union types |
87 | | -from adcp.types.generated import ( |
88 | | - ActivateSignalResponse, # Union of Response1 | Response2 |
89 | | - Destination, # Union of Destination1 | Destination2 |
90 | | -) |
91 | | -``` |
92 | | - |
93 | | -**Check type discriminators in conditional logic:** |
94 | | - |
95 | | -```python |
96 | | -# Before (v1.x) - used isinstance with aliases |
97 | | -if isinstance(destination, PlatformDestination): |
98 | | - print(f"Platform: {destination.platform}") |
99 | | - |
100 | | -# After (v2.0) - check discriminator field |
101 | | -if destination.root.type == "platform": |
102 | | - print(f"Platform: {destination.root.platform}") |
103 | | - |
104 | | -# Or unwrap the RootModel |
105 | | -dest = destination.root |
106 | | -if dest.type == "platform": |
107 | | - print(f"Platform: {dest.platform}") |
108 | | -``` |
109 | | - |
110 | 3 | ## [1.6.1](https://github.com/adcontextprotocol/adcp-client-python/compare/v1.6.0...v1.6.1) (2025-11-13) |
111 | 4 |
|
112 | 5 |
|
|
0 commit comments