Hi Viktor
The <entity>RefOrValue pattern was introduced so that APIs can pass data (input or output) by reference to an existing entity (in which case only id and href are important) or by value (in which case id and href may not even be present). So in Shopping Cart (and in Product Order), when the order is for a new product, the entire product will need to be embedded in the order. However an order for an existing product may not need the full product at all levels. So RefOrValue was used.
Hope it helps
------------------------------
Jonathan Goldberg
Amdocs Management Limited
Any opinions and statements made by me on this forum are purely personal, and do not necessarily reflect the position of the TM Forum or my employer.
------------------------------
Original Message:
Sent: Feb 10, 2022 07:07
From: Viktor Aleksandrov
Subject: TMF663 ShoppingCart API schemas: ProductRefOrValue vs. Product and ProductRef
Hi! There are two almost same data structures named ProductRefOrValue and Product in OpenAPI spec for ShoppingCart, they hold the same data and the former appears to be used in API methods, but the latter does not. I'm now trying to figure out why does spec ever contain Product and not only ProductRefOrValue. Is ProductRefOrValue supposed to be cast to Product or ProductRef case-by-case in implementation? Or is it provided just for an example?
------------------------------
Viktor Aleksandrov
OJSC "VimpelCom"
------------------------------