You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scope per maintainer confirmation in #649: checkout + cart in one PR, same root cause.
Problem
All five REST request bodies (create_checkout, update_checkout, complete_checkout, create_cart, update_cart) referenced the full base schema, so standard OpenAPI tooling (Swagger UI, Redoc, codegen) exposed every server-assigned field as writable — 12 ucp_request: "omit" fields on checkout and 9 on cart (id, status, totals, expires_at, continue_url, …), not just checkout.id as originally filed.
readOnly: true was considered and rejected: 28 ucp_request annotations are per-operation maps (e.g. cart.id is {"create": "omit", "update": "required"}, checkout.payment is required only on complete), which a binary, operation-global readOnly cannot express.
Change
Follows the existing catalog_search.json → $defs/search_request convention (also used by ask_request in #538):
checkout.json: add $defs/create_request, $defs/update_request, $defs/complete_request. Properties $ref the top-level definitions (#/properties/...) so descriptions stay single-sourced; the ucp_request annotations remain the source of truth.
cart.json: add $defs/create_request, $defs/update_request alongside the existing $defs/checkout.
rest.openapi.json: point the five request bodies at new *_request components, mirroring the catalog wiring.
Each $defs shape was verified byte-equivalent (properties + required) to the canonical derivation:
scripts/validate_examples.py full corpus — 282 passed, 0 failed
scripts/test_validate_examples.py — 48 passed
pre-commit run --all-files — passed (stylelint fails locally on a missing node module, unrelated; no CSS touched)
mkdocs build — no new warnings vs main (reference pages only render $defs via explicit macros, so schema pages are unchanged)
Notes
The now-unreferenced checkout/cart components are left in place (the payment component was already name-only) in case downstream codegen references them by name; happy to remove them if preferred.
mcp.openrpc.json has the same defect (create_checkout/update_checkout/complete_checkout tool params reference the full checkout.json). Left out of scope here as filed; can follow up if wanted.
Rebased onto main now that #633 has landed, and re-verified.
#633 changed cart.id's update annotation to the transition form (from: required → to: omit). ucp-schema resolve --request --op update still reports id as required for cart update today, so cart.json#/$defs/update_request is unchanged and remains byte-equivalent to the canonical derivation. All five shapes re-checked against the resolver after the rebase — still matching.
Re-ran on the rebased branch: ucp-schema lint 99 files passed, example corpus 282 passed / 0 failed, validator unit tests 48 passed.
Worth flagging for whoever picks up the transition follow-up: when cart.id completes its move to omit on update, the only change needed here is dropping id from properties and required in cart.json#/$defs/update_request — the OpenAPI wiring stays as-is.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #649.
Scope per maintainer confirmation in #649: checkout + cart in one PR, same root cause.
Problem
All five REST request bodies (
create_checkout,update_checkout,complete_checkout,create_cart,update_cart) referenced the full base schema, so standard OpenAPI tooling (Swagger UI, Redoc, codegen) exposed every server-assigned field as writable — 12ucp_request: "omit"fields on checkout and 9 on cart (id,status,totals,expires_at,continue_url, …), not justcheckout.idas originally filed.readOnly: truewas considered and rejected: 28ucp_requestannotations are per-operation maps (e.g.cart.idis{"create": "omit", "update": "required"},checkout.paymentis required only on complete), which a binary, operation-globalreadOnlycannot express.Change
Follows the existing
catalog_search.json→$defs/search_requestconvention (also used byask_requestin #538):checkout.json: add$defs/create_request,$defs/update_request,$defs/complete_request. Properties$refthe top-level definitions (#/properties/...) so descriptions stay single-sourced; theucp_requestannotations remain the source of truth.cart.json: add$defs/create_request,$defs/update_requestalongside the existing$defs/checkout.rest.openapi.json: point the five request bodies at new*_requestcomponents, mirroring the catalog wiring.Each
$defsshape was verified byte-equivalent (properties + required) to the canonical derivation:Verification
ucp-schema lint source/— 99 files, all passedscripts/validate_examples.pyfull corpus — 282 passed, 0 failedscripts/test_validate_examples.py— 48 passedpre-commit run --all-files— passed (stylelint fails locally on a missing node module, unrelated; no CSS touched)mkdocs build— no new warnings vsmain(reference pages only render$defsvia explicit macros, so schema pages are unchanged)Notes
checkout/cartcomponents are left in place (thepaymentcomponent was already name-only) in case downstream codegen references them by name; happy to remove them if preferred.cart.idto omitted in update requests; if it lands first,cart.json#/$defs/update_requestneeds a two-line follow-up (dropidfromproperties/required). Current shapes reflect the annotations onmaintoday.mcp.openrpc.jsonhas the same defect (create_checkout/update_checkout/complete_checkouttool params reference the fullcheckout.json). Left out of scope here as filed; can follow up if wanted.