Good morning,
I’ve been working on understanding how to upload several CatalogImage
instances registered to a given CatalogItem
, in the Java SDK in particular. To do this, I intend to first upload the CatalogItem
(wrapped within a CatalogObject
instance, of course), retrieve its ID from the upsert response, and then, for every image, use the CreateCatalogImageRequest
endpoint to supply both the image data and the ID that I got for the CatalogItem
that I uploaded earlier. That way, I can “register” all the images to that item.
However, upon studying the relationship of the various IDs, I noticed that in CatalogObject
, there exists an attribute (and accompanying accessor in the Java SDK) called image_id
. I am not sure what the benefit of that id is, considering that the CatalogObject
itself already has a unique id
field. The Javadoc reads:
/**
* Getter for ImageId.
* Identifies the `CatalogImage` attached to this `CatalogObject`.
* @return Returns the String
*/
@JsonGetter("image_id")
public String getImageId() {
return this.imageId;
}
The use of “attached” makes this even weirder for me, because:
(1) If it is supposed to represent the id of the current CatalogObject
which just so happens to embed a CatalogImage
, why do we need it, given the other id
field?
(2) If, on the other hand, it means that this ID is the ID of a CatalogImage
that we separately uploaded and registered to the CatalogObject
, why is there only one String
ID instead of a List
of those IDs?
Regards,
JF