Closed andrei-ivanov closed 2 years ago
It's a wrong definition in an upstream repository. Will be updated soon.
Thanks for the report
Hi could you please try the 7.5.0-SNAPSHOT from this location? https://oss.sonatype.org/content/repositories/snapshots/com/commercetools/sdk/commercetools-sdk-java-api/7.5.0-SNAPSHOT/
Seems to be working fine... The API changed a bit for the result type:
List<AssignedProductSelection> productSelections = projectApiRoot.products().withKey(productKey).productSelections().get().executeBlocking().getBody().getResults();
Btw, how do I expand that obj
?
INFO --- [ httpclient-dispatch-2] commercetools.products.response : GET https://api.europe-west1.gcp.commercetools.com/loylogic-poc/products/key=iphone-13/product-selections 200
INFO --- [ main] com.loylogic.experimental.commercetools.ProductSelectionsService : results: 2
INFO --- [ main] com.loylogic.experimental.commercetools.ProductSelectionsService : AssignedProductSelectionImpl[createdAt=2022-02-02T09:15:35.001Z,productSelection=ProductSelectionReferenceImpl[id=2e89d89b-bdfb-4339-8e53-7638966a97c2,obj=<null>,typeId=product-selection]]
INFO --- [ main] com.loylogic.experimental.commercetools.ProductSelectionsService : AssignedProductSelectionImpl[createdAt=2022-02-02T11:44:33.841Z,productSelection=ProductSelectionReferenceImpl[id=21a7ebc9-75e4-4be4-b3e7-a9808796ac1c,obj=<null>,typeId=product-selection]]
For expansion please use projectApiRoot.products().withKey(productKey).productSelections().get().withExpand("productSelection")
And yes the API had to change as it was documented wrong and the implementation was using the documentation :)
Got it, works great with the expansion too. Waiting for new releases now 😁
Thanks for the fixes
Released 8.0.0-beta.1 as a pre-release with the fixed return type
Fixed with 8.0.0
Thanks for the report
results in
As can be seen, the
createdAt
property gets initialized, but the others not, likeid
, since there seems to be aproductSelection
wrapper in the JSON.Stack information:
Same as the JS counterpart