-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cart discount query all cart discounts using composable API not working #744
Comments
Based on the stacktrace there seems to be some CartDiscount with a GiftLineItem and a reference to a product, which is not being correctly deserialized as it has no |
I actually could reproduce it, when creating a cartdiscount with a ResourceIdentifier to an product which didn't had a typeId set. I will open a bug ticket for the API. Nevertheless I may be able to fix this in the SDK by adjusting the ObjectMapper You could to this too in the mean time by customizing the ResponseSerializer:
|
Thank you for the solution.
|
Hi, While querying cart discounts using composable API getting an exception below. can you pls advice.
Exception
io.vrap.rmf.base.client.DeserializationException: Could not resolve subtype of [simple type, class com.commercetools.api.models.product.ProductReference]: missing type id property 'typeId' (for POJO property 'product')\n at [Source: REDACTED (
StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION
disabled); line: 1, column: 478] (through reference chain: com.commercetools.api.models.cart_discount.CartDiscountPagedQueryResponseImpl["results"]->java.util.ArrayList[0]->com.commercetools.api.models.cart_discount.CartDiscountImpl["value"]->com.commercetools.api.models.cart_discount.CartDiscountValueGiftLineItemImpl["product"])","stack_trace":"c.f.j.d.e.InvalidTypeIdException: Could not resolve subtype of [simple type, class com.commercetools.api.models.product.ProductReference]: missing type id property 'typeId' (for POJO property 'product')\n at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION
disabled); line: 1, column: 478] (through reference chain: com.commercetools.api.models.cart_discount.CartDiscountPagedQueryResponseImpl["results"]->java.util.ArrayList[0]->com.commercetools.api.models.cart_discount.CartDiscountImpl["value"]->com.commercetools.api.models.cart_discount.CartDiscountValueGiftLineItemImpl["product"])\r\n\tat c.f.j.d.e.InvalidTypeIdException.from(InvalidTypeIdException.java:43)\r\n\tat c.f.j.d.DeserializationContext.missingTypeIdException(DeserializationContext.java:2050)\r\n\tat c.f.j.d.DeserializationContext.handleMissingTypeId(DeserializationContext.java:1622)\r\n\tat c.f.j.d.j.i.TypeDeserializerBase._handleMissingTypeId(TypeDeserializerBase.java:307)\r\n\tat c.f.j.d.j.i.AsPropertyTypeDeserializer._deserializeTypedUsingDefaultImpl(AsPropertyTypeDeserializer.java:211)\r\n\tat c.f.j.d.j.i.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:145)\r\n\tat c.f.j.d.d.BeanDeserializerBase.deserializeWithType(BeanDeserializerBase.java:1380)\r\n\tat c.f.j.d.d.SettableBeanProperty.deserialize(SettableBeanProperty.java:542)\r\n\tat c.f.j.d.d.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:570)\r\n\tat c.f.j.d.d.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:440)\r\n\tat c.f.j.d.d.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1493)\r\n\tat c.f.j.d.d.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:348)\r\n\tat c.f.j.d.d.BeanDeserializer._deserializeOther(BeanDeserializer.java:220)\r\n\tat c.f.j.d.d.BeanDeserializer.deserialize(BeanDeserializer.java:187)\r\n\tat c.f.j.d.j.i.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:170)\r\n\tat c.f.j.d.j.i.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTy...\r\n"}The text was updated successfully, but these errors were encountered: