Skip to content

Commit acaae01

Browse files
bokelleyclaude
andauthored
chore: regenerate types from upstream shared PropertyTag/PropertyId schemas (#80)
The upstream AdCP schemas (v1.0.0) now use shared schema files for PropertyId and PropertyTag. Both adagents.json and publisher-property-selector.json now reference property-id.json and property-tag.json instead of defining their own versions. This eliminates the type collision that required SDK workarounds. Changes: - Sync schemas from upstream (property-id.json and property-tag.json now exist) - Regenerate types: PropertyId and PropertyTag now come from shared modules - Fix import formatting in aliases.py (linter requirement) - Remove orphaned Tag type from types/__init__.py - Update test: PropertyId/PropertyTag are now separate types, not inheritance - Add 5 tests to verify shared schema approach works correctly - Update documentation (CLAUDE.md) with fix details 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent aa7778b commit acaae01

17 files changed

+272
-117
lines changed

CLAUDE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,21 @@ from adcp.types.generated_poc.format import Asset as FormatAsset
134134
- Sharing common types via `$ref`
135135
- Using discriminated unions where appropriate
136136

137+
**PropertyTag/PropertyId Shared Schemas (Fixed Upstream in v1.0.0):**
138+
139+
As of AdCP v1.0.0, the upstream schemas were refactored to use shared schema files:
140+
- `property-id.json` - Single canonical definition of PropertyId
141+
- `property-tag.json` - Single canonical definition of PropertyTag
142+
143+
Both `adagents.json` and `publisher-property-selector.json` now reference these shared schemas instead of defining their own versions. This eliminates the previous type collision where both files defined identical but separate PropertyTag types.
144+
145+
The code generator now produces:
146+
- `src/adcp/types/generated_poc/property_id.py` - Generated from property-id.json
147+
- `src/adcp/types/generated_poc/property_tag.py` - Generated from property-tag.json
148+
- Both `adagents.py` and `publisher_property_selector.py` import from these shared modules
149+
150+
**No SDK workaround needed** - the type system now correctly has a single PropertyTag definition.
151+
137152
**Current fixes applied:**
138153

139154
1. **Self-referential types** - Fixes `preview_render.py` if it contains module-qualified self-references

schemas/cache/.hashes.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/index.json": "e07ecdba0bc0d4fba3fe5f8d7ce39cb60330dcb4b76a8717f14d606a76911ca6",
3-
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/adagents.json": "f32e3778a454b7ae65f42952906f06466008bfd1208b83729e14d5f2164902d5",
2+
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/index.json": "1937a679dee895a367e2bb904b089ecc86e7e794e1c478cac3b5075551d5882f",
3+
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/adagents.json": "d7d23a4ca339c2c8dcbefccfbe29fc3c7a58b6f8eed7ca2efcaf8d617fda37ef",
44
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/core/activation-key.json": "bb9c20c6200b651ce6db89f7160be60b9845dbbb4390a13363ea5b82c1c3c786",
55
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/core/assets/audio-asset.json": "e25d688d22c8b130d9d1a2a09f9aa462cb7a5c83db6eea6f328cd937f8625a3f",
66
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/core/assets/css-asset.json": "e0a3e3b668f564cf804d0b893833188203b8992cd5d118e4fd3d19c85cb501a1",
@@ -38,9 +38,11 @@
3838
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/core/product.json": "e1b4faa9029bd06baa537fbf534993e7830b1bdc2241279dea4806c134cea50d",
3939
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/core/promoted-offerings.json": "d8b4b92db0e2debc5c0ddbc0a8ff673f258f0bbc0348737df61be20a25827077",
4040
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/core/promoted-products.json": "77773b1dce91b219ec5043c091eb2977a82ba301e03aead3868ba704e625379e",
41-
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/core/property.json": "770734efdb4e0867c2367d5f12994fe53193f51bd8d03cb35bbb7b9b8b3d0a74",
41+
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/core/property-id.json": "46b21c016d58444aee5b5dae3e3a1e882cde274cf2c25f18e793ccace67617ea",
42+
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/core/property-tag.json": "798c575b3676823cc202dd69c5c31ec70954a6e7cc51b19f014c5f29153408ed",
43+
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/core/property.json": "e8374ba6180d16364e066aab85a429df4251be167e34fd3bccf2cf9f08ac1b41",
4244
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/core/protocol-envelope.json": "c6096b4ed4330c5e2045989bfd5cdc64fa6587cf8b0d1d2c19e33c7434cdacb8",
43-
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/core/publisher-property-selector.json": "3e4870d0446a5825c16365a99d49932517223c1d9d3d46a4fbf413d377ed43dd",
45+
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/core/publisher-property-selector.json": "53da1f4894c73aa8f823489b10c9f66d75251bb4c0f2421db16518f89f88a1c7",
4446
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/core/push-notification-config.json": "d712ce49b101b83535dc7effcdeeb64ed2c07c67bcd9aa42ef3ffd450bf7112a",
4547
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/core/reporting-capabilities.json": "c84fa2a1ecc71181aa42b71e2960742ea05d3f4113c9f7a2269c0b0d7ab618c4",
4648
"https://raw.githubusercontent.com/adcontextprotocol/adcp/main/static/schemas/v1/core/response.json": "0ac624a30da08e1aa90d2a9379f8c1ed29b704c3f5399224b9684672d3df9723",

schemas/cache/1.0.0/adagents.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@
244244
"property_ids": {
245245
"description": "Property IDs this agent is authorized for. Resolved against the top-level properties array in this file",
246246
"items": {
247-
"pattern": "^[a-z0-9_]+$",
248-
"type": "string"
247+
"$ref": "/schemas/v1/core/property-id.json"
249248
},
250249
"minItems": 1,
251250
"type": "array"
@@ -281,8 +280,7 @@
281280
"property_tags": {
282281
"description": "Tags identifying which properties this agent is authorized for. Resolved against the top-level properties array in this file using tag matching",
283282
"items": {
284-
"pattern": "^[a-z0-9_]+$",
285-
"type": "string"
283+
"$ref": "/schemas/v1/core/property-tag.json"
286284
},
287285
"minItems": 1,
288286
"type": "array"

schemas/cache/1.0.0/index.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,14 @@
146146
"$ref": "/schemas/v1/core/property.json",
147147
"description": "An advertising property that can be validated via adagents.json"
148148
},
149+
"property-id": {
150+
"$ref": "/schemas/v1/core/property-id.json",
151+
"description": "Identifier for a publisher property - lowercase alphanumeric with underscores only"
152+
},
153+
"property-tag": {
154+
"$ref": "/schemas/v1/core/property-tag.json",
155+
"description": "Tag for categorizing publisher properties - lowercase alphanumeric with underscores only"
156+
},
149157
"protocol-envelope": {
150158
"$ref": "/schemas/v1/core/protocol-envelope.json",
151159
"description": "Standard envelope structure added by protocol layer (MCP, A2A, REST) that wraps task response payloads with protocol-level fields like status, context_id, task_id, and message"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$id": "/schemas/v1/core/property-id.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"description": "Identifier for a publisher property. Must be lowercase alphanumeric with underscores only.",
5+
"examples": [
6+
"cnn_ctv_app",
7+
"homepage",
8+
"mobile_ios",
9+
"instagram"
10+
],
11+
"pattern": "^[a-z0-9_]+$",
12+
"title": "Property ID",
13+
"type": "string"
14+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$id": "/schemas/v1/core/property-tag.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"description": "Tag for categorizing publisher properties. Must be lowercase alphanumeric with underscores only.",
5+
"examples": [
6+
"ctv",
7+
"premium",
8+
"news",
9+
"sports",
10+
"meta_network",
11+
"social_media"
12+
],
13+
"pattern": "^[a-z0-9_]+$",
14+
"title": "Property Tag",
15+
"type": "string"
16+
}

schemas/cache/1.0.0/property.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@
3232
"type": "string"
3333
},
3434
"property_id": {
35-
"description": "Unique identifier for this property (optional). Enables referencing properties by ID instead of repeating full objects. Recommended format: lowercase with underscores (e.g., 'cnn_ctv_app', 'instagram_mobile')",
36-
"pattern": "^[a-z0-9_]+$",
37-
"type": "string"
35+
"$ref": "/schemas/v1/core/property-id.json",
36+
"description": "Unique identifier for this property (optional). Enables referencing properties by ID instead of repeating full objects."
3837
},
3938
"property_type": {
4039
"$ref": "/schemas/v1/enums/property-type.json",
@@ -47,9 +46,7 @@
4746
"tags": {
4847
"description": "Tags for categorization and grouping (e.g., network membership, content categories)",
4948
"items": {
50-
"description": "Lowercase tag with underscores (e.g., 'conde_nast_network', 'premium_content')",
51-
"pattern": "^[a-z0-9_]+$",
52-
"type": "string"
49+
"$ref": "/schemas/v1/core/property-tag.json"
5350
},
5451
"type": "array",
5552
"uniqueItems": true

schemas/cache/1.0.0/publisher-property-selector.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
"property_ids": {
3535
"description": "Specific property IDs from the publisher's adagents.json",
3636
"items": {
37-
"pattern": "^[a-z0-9_]+$",
38-
"type": "string"
37+
"$ref": "/schemas/v1/core/property-id.json"
3938
},
4039
"minItems": 1,
4140
"type": "array"
@@ -65,8 +64,7 @@
6564
"property_tags": {
6665
"description": "Property tags from the publisher's adagents.json. Selector covers all properties with these tags",
6766
"items": {
68-
"pattern": "^[a-z0-9_]+$",
69-
"type": "string"
67+
"$ref": "/schemas/v1/core/property-tag.json"
7068
},
7169
"minItems": 1,
7270
"type": "array"

src/adcp/types/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@
182182
StatusSummary,
183183
SyncCreativesRequest,
184184
SyncCreativesResponse,
185-
Tag,
186185
Tags,
187186
TargetingOverlay,
188187
Task,
@@ -426,7 +425,6 @@
426425
"Results",
427426
"Signal",
428427
"SignalFilters",
429-
"Tag",
430428
"Tags",
431429
"TargetingOverlay",
432430
"VenueBreakdownItem",

src/adcp/types/_generated.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
DO NOT EDIT MANUALLY.
1111
1212
Generated from: https://github.com/adcontextprotocol/adcp/tree/main/schemas
13-
Generation date: 2025-11-21 15:57:17 UTC
13+
Generation date: 2025-11-21 20:45:16 UTC
1414
"""
1515
# ruff: noqa: E501, I001
1616
from __future__ import annotations
@@ -19,7 +19,7 @@
1919
from adcp.types.generated_poc.activate_signal_request import ActivateSignalRequest
2020
from adcp.types.generated_poc.activate_signal_response import ActivateSignalResponse, ActivateSignalResponse1, ActivateSignalResponse2
2121
from adcp.types.generated_poc.activation_key import ActivationKey1, ActivationKey2
22-
from adcp.types.generated_poc.adagents import AuthorizedAgents, AuthorizedAgents1, AuthorizedAgents2, AuthorizedAgents3, AuthorizedSalesAgents, Contact, PropertyId, PropertyTag, Tags
22+
from adcp.types.generated_poc.adagents import AuthorizedAgents, AuthorizedAgents1, AuthorizedAgents2, AuthorizedAgents3, AuthorizedSalesAgents, Contact, Tags
2323
from adcp.types.generated_poc.adcp_domain import AdcpDomain
2424
from adcp.types.generated_poc.asset_content_type import AssetContentType
2525
from adcp.types.generated_poc.audio_asset import AudioAsset
@@ -104,7 +104,9 @@
104104
from adcp.types.generated_poc.product_filters import ProductFilters
105105
from adcp.types.generated_poc.promoted_offerings import AssetSelectors, AssetType, Offering, PromotedOfferings
106106
from adcp.types.generated_poc.promoted_products import PromotedProducts
107-
from adcp.types.generated_poc.property import Identifier, Property, Tag
107+
from adcp.types.generated_poc.property import Identifier, Property
108+
from adcp.types.generated_poc.property_id import PropertyId
109+
from adcp.types.generated_poc.property_tag import PropertyTag
108110
from adcp.types.generated_poc.property_type import PropertyType
109111
from adcp.types.generated_poc.protocol_envelope import ProtocolEnvelope
110112
from adcp.types.generated_poc.provide_performance_feedback_request import ProvidePerformanceFeedbackRequest, ProvidePerformanceFeedbackRequest1, ProvidePerformanceFeedbackRequest2
@@ -202,7 +204,7 @@
202204
"SignalCatalogType", "SignalFilters", "Sort", "SortApplied", "SortDirection",
203205
"StandardFormatIds", "Status", "StatusSummary", "SubAsset1", "SubAsset2",
204206
"SyncCreativesRequest", "SyncCreativesResponse", "SyncCreativesResponse1",
205-
"SyncCreativesResponse2", "Tag", "Tags", "TargetingOverlay", "Task", "TaskStatus", "TaskType",
207+
"SyncCreativesResponse2", "Tags", "TargetingOverlay", "Task", "TaskStatus", "TaskType",
206208
"TasksGetRequest", "TasksGetResponse", "TasksListRequest", "TasksListResponse", "TextAsset",
207209
"Totals", "Type", "UpdateFrequency", "UpdateMediaBuyRequest", "UpdateMediaBuyRequest1",
208210
"UpdateMediaBuyRequest2", "UpdateMediaBuyResponse", "UpdateMediaBuyResponse1",

0 commit comments

Comments
 (0)