Closed redxiiikk closed 1 year ago
With the introduction of the direct discounts to the API a change in the documentation for the DiscountedLineItemPortion had been missed.
We will have to fix it in the documentation so that it will be taken by the code generator to update the SDK.
Just released 14.0.0 of the SDK which adds the DirectDiscountReference and should correctly deserialize the cart now.
Describe the bug
direct_discount can not deserialization when query cart by sdk
To Reproduce
Screenshots/Code snippet
Exception message and stack:![image](https://user-images.githubusercontent.com/72877527/231925803-156e8368-f33f-40fd-b7f2-b32a5acc8f8b.png)
import message:
Caused by: com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id 'direct-discount' as a subtype of
com.commercetools.api.models.cart_discount.CartDiscountReference
: known type ids = [attribute-group, business-unit, cart, cart-discount, category, channel, customer, customer-group, discount-code, inventory-entry, key-value-document, order, order-edit, payment, product, product-discount, product-selection, product-type, quote, quote-request, review, shipping-method, shopping-list, staged-quote, standalone-price, state, store, tax-category, type, zone] (for POJO property 'discount')at [Source: (byte[])"{"limit":100,"offset":0,"count":3,"total":3,"results":[{"type":"Cart","id":"xxxxxxxx-85e9c7196c1a","version":1,"versionModifiedAt":"2023-04-13T09:23:27.605Z","lastMessageSequenceNumber":1,"createdAt":"2023-04-13T09:23:27.605Z","lastModifiedAt":"2023-04-13T09:23:27.605Z","lastModifiedBy":{"clientId":"xxxxxxxxg4XnVsB9P","isPlatformClient":false},"createdBy":{"clientId":"xxxxxxxxg4XnVsB9P","isPlatformClient":false},"key":"cart-xxxxxx06606","customerId":"xxxxxxxx-8cb1-47f"[truncated 11429 bytes]; line: 1, column: 9570] (through reference chain: com.commercetools.api.models.cart.CartPagedQueryResponseImpl["results"]->java.util.ArrayList[2]->com.commercetools.api.models.cart.CartImpl["lineItems"]->java.util.ArrayList[0]->com.commercetools.api.models.cart.LineItemImpl["discountedPricePerQuantity"]->java.util.ArrayList[0]->com.commercetools.api.models.cart.DiscountedLineItemPriceForQuantityImpl["discountedPrice"]->com.commercetools.api.models.cart.DiscountedLineItemPriceImpl["includedDiscounts"]->java.util.ArrayList[0]->com.commercetools.api.models.cart.DiscountedLineItemPortionImpl["discount"])
response of postman query cart list:![image](https://user-images.githubusercontent.com/72877527/231926018-ecaa170f-fa04-492d-9d18-8ff82d02aebd.png)
Stack information (please complete the following information):