@epcc-sdk/sdks-cart-checkout-order/zod provides schemas for validating API payloads. Two of them silently remove data:
zCheckoutApiBody.parse(body) on an account checkout removes data.account and data.contact.
zCartsResponse.parse(response), used for the response to adding items to a cart, removes most item fields.
Expected: parsing a valid payload keeps all of its fields.
Cause:
- In the checkout schema, every field of the customer-checkout shape is optional, so an account checkout matches that shape first and its extra fields are stripped.
- In the cart schema, response items are described with the request item shapes.
The TypeScript types are correct; only the schemas are affected.
@epcc-sdk/sdks-cart-checkout-order/zodprovides schemas for validating API payloads. Two of them silently remove data:zCheckoutApiBody.parse(body)on an account checkout removesdata.accountanddata.contact.zCartsResponse.parse(response), used for the response to adding items to a cart, removes most item fields.Expected: parsing a valid payload keeps all of its fields.
Cause:
The TypeScript types are correct; only the schemas are affected.