Skip to content

fix!: rename variant.selected_options → options#353

Merged
igrigorik merged 1 commit intomainfrom
fix/variant-options-rename
Apr 11, 2026
Merged

fix!: rename variant.selected_options → options#353
igrigorik merged 1 commit intomainfrom
fix/variant-options-rename

Conversation

@igrigorik
Copy link
Copy Markdown
Contributor

image

PR #195 described the change and intent but commit got lost between working and merged branch (doh!). This PR lands the change described in 195. This is a breaking change relative to current schema: variant.selected_optionsvariant.options. With this change in place, we have:

  • 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)

Checklist

  • Breaking change
  • Documentation update
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

  Completes a rename decided in PR #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
@igrigorik igrigorik self-assigned this Apr 10, 2026
@igrigorik igrigorik requested review from a team as code owners April 10, 2026 22:02
@igrigorik igrigorik added the TC review Ready for TC review label Apr 10, 2026
@igrigorik igrigorik requested review from mmohades and yanheChen April 10, 2026 22:02
@igrigorik igrigorik merged commit 616b62d into main Apr 11, 2026
12 checks passed
@igrigorik igrigorik deleted the fix/variant-options-rename branch April 11, 2026 05:15
jingyli pushed a commit to jingyli/ucp that referenced this pull request Apr 13, 2026
…l#353)

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
jingyli added a commit that referenced this pull request Apr 13, 2026
Completes a rename decided in PR #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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TC review Ready for TC review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants