Skip to content

Commit dcdaf67

Browse files
bokelleyclaude
andcommitted
feat: standardize format field naming for clarity and consistency
Implement consistent naming convention to eliminate confusion between format objects and format IDs: - "formats" = array of format objects (with full details) - "format_ids" = array of format ID strings (references) - "format_types" = array of high-level type strings (video, display, audio) ## Schema Changes - Product schema: "formats" → "format_ids" (array of format ID strings) - get_products request: Remove redundant "formats" filter (duplicated format_types) - create_media_buy request: "formats" → "format_ids" (array of format ID strings) ## Documentation Updates - Updated all examples and field descriptions - Fixed parameter tables and API documentation - Updated validation examples and tests ## Benefits - Eliminates ambiguity between format objects vs format IDs - Clear field naming that indicates content type immediately - Consistent API design across all endpoints - Better developer experience with self-documenting field names Fixes confusion where "formats" was used for both format objects and format IDs in different contexts. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent de101b6 commit dcdaf67

File tree

10 files changed

+33
-41
lines changed

10 files changed

+33
-41
lines changed

docs/media-buy/media-products.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ A server can offer a general catalog, but it can also return:
8686
"product_id": "connected_tv_prime",
8787
"name": "Connected TV - Prime Time",
8888
"description": "Premium CTV inventory 8PM-11PM",
89-
"formats": [{"format_id": "video_standard", "name": "Standard Video"}],
89+
"format_ids": ["video_standard"],
9090
"delivery_type": "guaranteed",
9191
"is_fixed_price": true,
9292
"cpm": 45.00
@@ -99,7 +99,7 @@ A server can offer a general catalog, but it can also return:
9999
"product_id": "custom_abc123",
100100
"name": "Custom - Gaming Enthusiasts",
101101
"description": "Custom audience package for gaming campaign",
102-
"formats": [{"format_id": "display_300x250", "name": "Medium Rectangle"}],
102+
"format_ids": ["display_300x250"],
103103
"delivery_type": "non_guaranteed",
104104
"is_fixed_price": false,
105105
"price_guidance": {
@@ -118,10 +118,10 @@ A server can offer a general catalog, but it can also return:
118118
"product_id": "albertsons_pet_category_offsite",
119119
"name": "Pet Category Shoppers - Offsite Display & Video",
120120
"description": "Target Albertsons shoppers who have purchased pet products in the last 90 days. Reach them across premium display and video inventory.",
121-
"formats": [
122-
{"format_id": "display_300x250", "name": "Medium Rectangle"},
123-
{"format_id": "display_728x90", "name": "Leaderboard"},
124-
{"format_id": "video_15s_vast", "name": "15-second VAST"}
121+
"format_ids": [
122+
"display_300x250",
123+
"display_728x90",
124+
"video_15s_vast"
125125
],
126126
"delivery_type": "guaranteed",
127127
"is_fixed_price": true,

docs/media-buy/tasks/create_media_buy.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Create a media buy from selected packages. This task handles the complete workfl
3333
|-----------|------|----------|-------------|
3434
| `buyer_ref` | string | Yes | Buyer's reference identifier for this package |
3535
| `products` | string[] | Yes | Array of product IDs to include in this package |
36-
| `formats` | string[] | Yes | Array of format IDs that will be used for this package - must be supported by all products |
36+
| `format_ids` | string[] | Yes | Array of format IDs that will be used for this package - must be supported by all products |
3737
| `budget` | Budget | No | Budget configuration for this package (overrides media buy level budget if specified) |
3838
| `targeting_overlay` | TargetingOverlay | No | Additional targeting criteria for this package (see Targeting Overlay Object below) |
3939

@@ -121,7 +121,7 @@ The AdCP payload is identical across protocols. Only the request/response wrappe
121121
{
122122
"buyer_ref": "nike_ctv_sports_package",
123123
"products": ["ctv_sports_premium", "ctv_prime_time"],
124-
"formats": ["video_standard_30s", "video_standard_15s"],
124+
"format_ids": ["video_standard_30s", "video_standard_15s"],
125125
"budget": {
126126
"total": 60000,
127127
"currency": "USD",
@@ -136,7 +136,7 @@ The AdCP payload is identical across protocols. Only the request/response wrappe
136136
{
137137
"buyer_ref": "nike_audio_drive_package",
138138
"products": ["audio_drive_time"],
139-
"formats": ["audio_standard_30s"],
139+
"format_ids": ["audio_standard_30s"],
140140
"budget": {
141141
"total": 40000,
142142
"currency": "USD",
@@ -257,7 +257,7 @@ await a2a.send({
257257
{
258258
"buyer_ref": "nike_ctv_sports_package",
259259
"products": ["ctv_sports_premium", "ctv_prime_time"],
260-
"formats": ["video_standard_30s", "video_standard_15s"],
260+
"format_ids": ["video_standard_30s", "video_standard_15s"],
261261
"budget": {
262262
"total": 60000,
263263
"currency": "USD",
@@ -272,7 +272,7 @@ await a2a.send({
272272
{
273273
"buyer_ref": "nike_audio_drive_package",
274274
"products": ["audio_drive_time"],
275-
"formats": ["audio_standard_30s"],
275+
"format_ids": ["audio_standard_30s"],
276276
"budget": {
277277
"total": 40000,
278278
"currency": "USD",
@@ -570,7 +570,7 @@ data: {"status": {"state": "completed"}, "artifacts": [...]}
570570
{
571571
"buyer_ref": "purina_ctv_package",
572572
"products": ["ctv_prime_time", "ctv_late_night"],
573-
"formats": ["video_standard_30s"],
573+
"format_ids": ["video_standard_30s"],
574574
"budget": {
575575
"total": 30000,
576576
"currency": "USD",
@@ -590,7 +590,7 @@ data: {"status": {"state": "completed"}, "artifacts": [...]}
590590
{
591591
"buyer_ref": "purina_audio_package",
592592
"products": ["audio_drive_time"],
593-
"formats": ["audio_standard_30s"],
593+
"format_ids": ["audio_standard_30s"],
594594
"budget": {
595595
"total": 20000,
596596
"currency": "USD"
@@ -621,7 +621,7 @@ data: {"status": {"state": "completed"}, "artifacts": [...]}
621621
{
622622
"buyer_ref": "purina_albertsons_conquest",
623623
"products": ["albertsons_competitive_conquest", "albertsons_onsite_display"],
624-
"formats": ["display_300x250", "display_728x90"],
624+
"format_ids": ["display_300x250", "display_728x90"],
625625
"budget": {
626626
"total": 75000,
627627
"currency": "USD",

docs/media-buy/tasks/get_products.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ Discover available advertising products based on campaign requirements, using na
2525
| Parameter | Type | Required | Description |
2626
|-----------|------|----------|-------------|
2727
| `delivery_type` | string | No | Filter by delivery type: `"guaranteed"` or `"non_guaranteed"` |
28-
| `formats` | string[] | No | Filter by specific formats (e.g., `["video"]`) |
2928
| `is_fixed_price` | boolean | No | Filter for fixed price vs auction products |
3029
| `format_types` | string[] | No | Filter by format types (e.g., `["video", "display"]`) |
3130
| `format_ids` | string[] | No | Filter by specific format IDs (e.g., `["video_standard_30s"]`) |
@@ -49,7 +48,7 @@ The message is returned differently in each protocol:
4948
"product_id": "string",
5049
"name": "string",
5150
"description": "string",
52-
"formats": [
51+
"format_ids": [
5352
"format_id_string"
5453
],
5554
"delivery_type": "string",
@@ -77,7 +76,7 @@ The message is returned differently in each protocol:
7776
- **product_id**: Unique identifier for the product
7877
- **name**: Human-readable product name
7978
- **description**: Detailed description of the product and its inventory
80-
- **formats**: Array of supported creative format IDs (strings) - use `list_creative_formats` to get full format details
79+
- **format_ids**: Array of supported creative format IDs (strings) - use `list_creative_formats` to get full format details
8180
- **delivery_type**: Either `"guaranteed"` or `"non_guaranteed"`
8281
- **is_fixed_price**: Whether this product has fixed pricing (true) or uses auction (false)
8382
- **cpm**: Cost per thousand impressions in USD
@@ -119,7 +118,7 @@ The AdCP payload is identical across protocols. Only the request/response wrappe
119118
"product_id": "ctv_sports_premium",
120119
"name": "CTV Sports Premium",
121120
"description": "Premium CTV inventory on sports content",
122-
"formats": ["video_16x9_30s"],
121+
"format_ids": ["video_16x9_30s"],
123122
"delivery_type": "guaranteed",
124123
"is_fixed_price": true,
125124
"cpm": 45.00,
@@ -191,7 +190,7 @@ A2A returns results as artifacts with text and data parts:
191190
"product_id": "ctv_sports_premium",
192191
"name": "CTV Sports Premium",
193192
"description": "Premium CTV inventory on sports content",
194-
"formats": ["video_16x9_30s"],
193+
"format_ids": ["video_16x9_30s"],
195194
"delivery_type": "guaranteed",
196195
"is_fixed_price": true,
197196
"cpm": 45.00,
@@ -239,7 +238,7 @@ A2A returns results as artifacts with text and data parts:
239238
"promoted_offering": "Peloton Digital Membership - unlimited access to live and on-demand fitness classes, promoting New Year special pricing",
240239
"filters": {
241240
"delivery_type": "guaranteed",
242-
"formats": ["video"],
241+
"format_types": ["video"],
243242
"is_fixed_price": true,
244243
"standard_formats_only": true
245244
}
@@ -264,7 +263,7 @@ A2A returns results as artifacts with text and data parts:
264263
"product_id": "open_exchange_video",
265264
"name": "Open Exchange - Video",
266265
"description": "Programmatic video inventory across all publishers",
267-
"formats": ["video_standard"],
266+
"format_ids": ["video_standard"],
268267
"delivery_type": "non_guaranteed",
269268
"is_fixed_price": false,
270269
"cpm": 12.00,
@@ -287,7 +286,7 @@ A2A returns results as artifacts with text and data parts:
287286
"product_id": "connected_tv_prime",
288287
"name": "Connected TV - Prime Time",
289288
"description": "Premium CTV inventory 8PM-11PM",
290-
"formats": ["video_standard"],
289+
"format_ids": ["video_standard"],
291290
"delivery_type": "guaranteed",
292291
"is_fixed_price": true,
293292
"cpm": 45.00,
@@ -309,7 +308,7 @@ A2A returns results as artifacts with text and data parts:
309308
"product_id": "albertsons_pet_category_syndicated",
310309
"name": "Pet Category Shoppers - Syndicated",
311310
"description": "Target Albertsons shoppers who have purchased pet products in the last 90 days across offsite display and video inventory.",
312-
"formats": [
311+
"format_ids": [
313312
"display_300x250",
314313
"video_15s_vast"
315314
],
@@ -335,7 +334,7 @@ A2A returns results as artifacts with text and data parts:
335334
"product_id": "albertsons_custom_competitive_conquest",
336335
"name": "Custom: Competitive Dog Food Buyers",
337336
"description": "Custom audience of Albertsons shoppers who buy competitive dog food brands. Higher precision targeting for conquest campaigns.",
338-
"formats": [
337+
"format_ids": [
339338
"display_300x250",
340339
"display_728x90"
341340
],

static/schemas/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const product = {
9494
"product_id": "ctv_sports_premium",
9595
"name": "CTV Sports Premium",
9696
"description": "Premium CTV inventory on sports content",
97-
"formats": [{"format_id": "video_16x9_30s", "name": "30-second video"}],
97+
"format_ids": ["video_16x9_30s"],
9898
"delivery_type": "guaranteed",
9999
"is_fixed_price": true
100100
};
@@ -120,7 +120,7 @@ product = {
120120
"product_id": "ctv_sports_premium",
121121
"name": "CTV Sports Premium",
122122
"description": "Premium CTV inventory on sports content",
123-
"formats": [{"format_id": "video_16x9_30s", "name": "30-second video"}],
123+
"format_ids": ["video_16x9_30s"],
124124
"delivery_type": "guaranteed",
125125
"is_fixed_price": True
126126
}

static/schemas/v1/core/product.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"type": "string",
1818
"description": "Detailed description of the product and its inventory"
1919
},
20-
"formats": {
20+
"format_ids": {
2121
"type": "array",
2222
"description": "Array of supported creative format IDs - use list_creative_formats to get full format details",
2323
"items": {
@@ -66,7 +66,7 @@
6666
"product_id",
6767
"name",
6868
"description",
69-
"formats",
69+
"format_ids",
7070
"delivery_type",
7171
"is_fixed_price"
7272
],

static/schemas/v1/media-buy/create-media-buy-request.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"type": "string"
3333
}
3434
},
35-
"formats": {
35+
"format_ids": {
3636
"type": "array",
3737
"description": "Array of format IDs that will be used for this package - must be supported by all products",
3838
"items": {
@@ -48,7 +48,7 @@
4848
}
4949
},
5050
"anyOf": [
51-
{"required": ["buyer_ref", "products", "formats"]},
51+
{"required": ["buyer_ref", "products", "format_ids"]},
5252
{"required": ["buyer_ref", "products", "format_selection"]}
5353
],
5454
"additionalProperties": false

static/schemas/v1/media-buy/get-products-request.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@
2626
"delivery_type": {
2727
"$ref": "/schemas/v1/enums/delivery-type.json"
2828
},
29-
"formats": {
30-
"type": "array",
31-
"description": "Filter by specific formats",
32-
"items": {
33-
"type": "string"
34-
}
35-
},
3629
"is_fixed_price": {
3730
"type": "boolean",
3831
"description": "Filter for fixed price vs auction products"

static/schemas/validation-example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const exampleProduct = {
3737
"product_id": "ctv_sports_premium",
3838
"name": "CTV Sports Premium",
3939
"description": "Premium CTV inventory on sports content",
40-
"formats": [{"format_id": "video_16x9_30s", "name": "30-second video"}],
40+
"format_ids": ["video_16x9_30s"],
4141
"delivery_type": "guaranteed",
4242
"is_fixed_price": true
4343
};

tests/example-validation.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const exampleData = {
121121
"product_id": "ctv_sports_premium",
122122
"name": "CTV Sports Premium",
123123
"description": "Premium CTV inventory on sports content",
124-
"formats": [{"format_id": "video_16x9_30s", "name": "30-second video"}],
124+
"format_ids": ["video_16x9_30s"],
125125
"delivery_type": "guaranteed",
126126
"is_fixed_price": true,
127127
"cpm": 45.00,
@@ -201,7 +201,7 @@ const exampleData = {
201201
"product_id": "ctv_sports_premium",
202202
"name": "CTV Sports Premium",
203203
"description": "Premium CTV inventory on sports content",
204-
"formats": [{"format_id": "video_16x9_30s", "name": "30-second video"}],
204+
"format_ids": ["video_16x9_30s"],
205205
"delivery_type": "guaranteed",
206206
"is_fixed_price": true,
207207
"cpm": 45.00,

tests/schema-validation.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ async function runTests() {
272272
await test('Core schemas have appropriate required fields', () => {
273273
const coreSchemas = schemas.filter(([path]) => path.includes('/core/'));
274274
const requiredFieldChecks = {
275-
'product.json': ['product_id', 'name', 'description', 'formats', 'delivery_type', 'is_fixed_price'],
275+
'product.json': ['product_id', 'name', 'description', 'format_ids', 'delivery_type', 'is_fixed_price'],
276276
'media-buy.json': ['media_buy_id', 'status', 'promoted_offering', 'total_budget', 'packages'],
277277
'package.json': ['package_id', 'status'],
278278
'creative-asset.json': ['creative_id', 'name', 'format'],

0 commit comments

Comments
 (0)