Using @commercetools/platform-sdk@2.3.0, I'm fetching the productSelections for a product:
const response = await requestBuilder().products().withKey({key: productKey}).productSelections().get().execute();
AFAIS, response has a type of ClientResponse<ProductSelectionPagedQueryResponse>response.body is a ProductSelectionPagedQueryResponseresponse.body.results is a ProductSelection[]
The problem I see is that the values contained in the array don't seem to match the properties defined in ProductSelection:
Since response.body.results[0] should be a ProductSelection, there should be a response.body.results[0].id property and all the others properties defined in ProductSelection.
Instead it seems some properties were placed in that response.body.results[0].productSelection wrapper.
I think the same issue is reproducible for the Java SDK 7.6.0 too:
Using
@commercetools/platform-sdk@2.3.0
, I'm fetching theproductSelections
for aproduct
:const response = await requestBuilder().products().withKey({key: productKey}).productSelections().get().execute();
AFAIS,
response
has a type ofClientResponse<ProductSelectionPagedQueryResponse>
response.body
is aProductSelectionPagedQueryResponse
response.body.results
is aProductSelection[]
The problem I see is that the values contained in the array don't seem to match the properties defined in
ProductSelection
:Since
response.body.results[0]
should be aProductSelection
, there should be aresponse.body.results[0].id
property and all the others properties defined inProductSelection
. Instead it seems some properties were placed in thatresponse.body.results[0].productSelection
wrapper.I think the same issue is reproducible for the Java SDK
7.6.0
too: