Skip to content

Commit 6373733

Browse files
jingyliigrigorik
andauthored
fix!: rename variant.selected_options → options (Universal-Commerce-Protocol#353) (Universal-Commerce-Protocol#356)
Completes a rename decided in PR Universal-Commerce-Protocol#195 (get_product operation) but never executed on variant.json. The get_product operation introduced three distinct concepts that were previously conflated: request.selected — what the user chose (input parameter) product.selected — what the server resolved (response, post-relaxation) variant.options — what the variant IS (intrinsic, immutable) A variant's option values (Color: Blue, Size: Large) are intrinsic identity — they don't change based on user selections or server relaxation. The old name "selected_options" implied a relationship to user selection state that doesn't exist at the variant level. Schema: variant.selected_options → variant.options Docs: update variant examples in mcp.md and rest.md Co-authored-by: Ilya Grigorik <ilya@grigorik.com>
1 parent d24e498 commit 6373733

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

docs/specification/catalog/mcp.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ Maps to the [Catalog Search](search.md) capability.
214214
"description": { "plain": "Size 10 variant" },
215215
"price": { "amount": 12000, "currency": "USD" },
216216
"availability": { "available": true },
217-
"selected_options": [
217+
"options": [
218218
{ "name": "Size", "label": "10" }
219219
],
220220
"tags": ["running", "road", "neutral"],
@@ -554,7 +554,7 @@ Maps to the [Catalog Lookup](lookup.md#get-product-get_product) capability. Retu
554554
"description": { "plain": "Blue, Size 10" },
555555
"price": { "amount": 12000, "currency": "USD" },
556556
"availability": { "available": true },
557-
"selected_options": [
557+
"options": [
558558
{ "name": "Color", "label": "Blue" },
559559
{ "name": "Size", "label": "10" }
560560
]
@@ -566,7 +566,7 @@ Maps to the [Catalog Lookup](lookup.md#get-product-get_product) capability. Retu
566566
"description": { "plain": "Blue, Size 12" },
567567
"price": { "amount": 15000, "currency": "USD" },
568568
"availability": { "available": true },
569-
"selected_options": [
569+
"options": [
570570
{ "name": "Color", "label": "Blue" },
571571
{ "name": "Size", "label": "12" }
572572
]

docs/specification/catalog/rest.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Maps to the [Catalog Search](search.md) capability.
152152
"description": { "plain": "Size 10 variant" },
153153
"price": { "amount": 12000, "currency": "USD" },
154154
"availability": { "available": true },
155-
"selected_options": [
155+
"options": [
156156
{ "name": "Size", "label": "10" }
157157
],
158158
"tags": ["running", "road", "neutral"],
@@ -428,7 +428,7 @@ on option values and returns variants matching the selection.
428428
"description": { "plain": "Blue, Size 10" },
429429
"price": { "amount": 12000, "currency": "USD" },
430430
"availability": { "available": true },
431-
"selected_options": [
431+
"options": [
432432
{ "name": "Color", "label": "Blue" },
433433
{ "name": "Size", "label": "10" }
434434
]
@@ -440,7 +440,7 @@ on option values and returns variants matching the selection.
440440
"description": { "plain": "Blue, Size 12" },
441441
"price": { "amount": 15000, "currency": "USD" },
442442
"availability": { "available": true },
443-
"selected_options": [
443+
"options": [
444444
{ "name": "Color", "label": "Blue" },
445445
{ "name": "Size", "label": "12" }
446446
]

source/schemas/shopping/types/variant.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@
117117
}
118118
}
119119
},
120-
"selected_options": {
120+
"options": {
121121
"type": "array",
122122
"items": {
123123
"$ref": "selected_option.json"
124124
},
125-
"description": "Option selections that define this variant."
125+
"description": "Option values that define this variant (e.g., Color: Blue, Size: Large)."
126126
},
127127
"media": {
128128
"type": "array",

0 commit comments

Comments
 (0)