fix: Fix inconsistent schema on documentation examples & discounts extension schema#371
Conversation
cusell-google
left a comment
There was a problem hiding this comment.
Some automated doc checks were skipped, could you make sure they run before merging?
| "item": { | ||
| "id": "item_123", | ||
| "title": "Blue Jeans", | ||
| "price": 5000 |
There was a problem hiding this comment.
@jingyli Is it worth modeling this as the price.json obj that is both amount and currency?
https://github.com/Universal-Commerce-Protocol/ucp/blob/6b61c3f7dab1a7825dc6c8a7c8c433d426db21d5/source/schemas/shopping/types/price.json
There was a problem hiding this comment.
My thinking is that the current model is more explicit: we already have currency at the checkout object level - https://github.com/Universal-Commerce-Protocol/ucp/blob/main/source/schemas/shopping/checkout.json#L74 - and our expectation is that all amounts in the checkout object should follow that currency field.
|
@cusell-google Thanks for the review! The skipped checks are expected - those checks should only be executed as part of the release workflow. |
raginpirate
left a comment
There was a problem hiding this comment.
Technically this is a breaking change, because the readOnly was not our expected control over the output schemas and validation here. But we should be fine accepting this given our belief that consumers of the spec will not be impacted and would have interpreted this the same way.
mmohades
left a comment
There was a problem hiding this comment.
Thanks for catching this inconsistency in the docs!
Description
This PR aims to address some minor schema inconsistencies that are present in the current UCP spec:
discount.md: Update all the examples to follow the correct UCP schema -item.idis the only field populated in requests,quantitypulled out to theline_itemlevel, etc.checkout-rest.mdandcheckout-mcp.md: Remove unsupportedavailable_quantityfield and add in other required fields likeitemin business error example.readOnlyannotation indiscount.json.Type of change
Please delete options that are not relevant.
Checklist