Skip to content
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

Item::deserialize Issue #817

Open
salyangoz opened this issue Nov 15, 2024 · 1 comment
Open

Item::deserialize Issue #817

salyangoz opened this issue Nov 15, 2024 · 1 comment

Comments

@salyangoz
Copy link

salyangoz commented Nov 15, 2024

Hello,

We encountered an issue when trying to deserialize the following JSON object using Item::deserialize. It appears that the deserialization fails when the attributes field is included in the JSON. If the attributes field is removed, the deserialization works as expected.

Steps to Reproduce:

  1. Use the provided JSON below. (Got from listingsItemsV20210801)
  2. Call Item::deserialize($item) with the JSON data.
  3. Observe that the deserialization fails when the attributes field is included.
    Test JSON:

{ "sku": "CC1-101-HANDBAG-BLACK-2", "summaries": [ { "marketplaceId": "A33AVAJ2PDY3EV", "asin": "B0BZF9566H", "productType": "HANDBAG", "conditionType": "new_new", "status": [], "itemName": "BMW M Motorsport Omuz Çantası Black Code", "createdDate": "2023-03-23T17:12:13.951Z", "lastUpdatedDate": "2023-03-23T17:12:13.951Z" } ], "attributes": { "color": [ { "language_tag": "tr_TR", "standardized_values": [ "Siyah" ], "value": "Red", "marketplace_id": "A33AVAJ2PDY3EV" } ], "variation_theme": [ { "name": "COLOR", "marketplace_id": "A33AVAJ2PDY3EV" } ], "country_of_origin": [ { "value": "TR", "marketplace_id": "A33AVAJ2PDY3EV" } ], "outer": [ { "material": [ { "language_tag": "tr_TR", "value": "Sentetik" } ], "marketplace_id": "A33AVAJ2PDY3EV" } ], "merchant_shipping_group": [ { "value": "legacy-template-id", "marketplace_id": "A33AVAJ2PDY3EV" } ], "item_name": [ { "language_tag": "tr_TR", "value": "BMW M Motorsport Omuz Çantası Black Code", "marketplace_id": "A33AVAJ2PDY3EV" } ], "batteries_required": [ { "value": "false", "marketplace_id": "A33AVAJ2PDY3EV" } ], "inner": [ { "material": [ { "language_tag": "tr_TR", "value": "Tekstil" } ], "marketplace_id": "A33AVAJ2PDY3EV" } ], "manufacturer": [ { "language_tag": "tr_TR", "value": "Genel", "marketplace_id": "A33AVAJ2PDY3EV" } ], "condition_type": [ { "value": "new_new", "marketplace_id": "A33AVAJ2PDY3EV" } ], "recommended_browse_nodes": [ { "value": "13546848031", "marketplace_id": "A33AVAJ2PDY3EV" } ], "part_number": [ { "value": "078804_01_OSFA", "marketplace_id": "A33AVAJ2PDY3EV" } ], "department": [ { "language_tag": "tr_TR", "value": "Erkek", "marketplace_id": "A33AVAJ2PDY3EV" } ], "product_description": [ { "language_tag": "tr_TR", "value": "BMW M Motorsport Omuz Çantası -2", "marketplace_id": "A33AVAJ2PDY3EV" } ], "brand": [ { "language_tag": "tr_TR", "value": "Genel", "marketplace_id": "A33AVAJ2PDY3EV" } ], "supplier_declared_dg_hz_regulation": [ { "value": "not_applicable", "marketplace_id": "A33AVAJ2PDY3EV" } ], "parentage_level": [ { "marketplace_id": "A33AVAJ2PDY3EV", "value": "child" } ], "child_parent_sku_relationship": [ { "marketplace_id": "A33AVAJ2PDY3EV", "child_relationship_type": "variation", "parent_sku": "CC1-102-HANDBAG" } ] }, "issues": [ { "code": "18730", "message": "Bu ASIN için Genel markası, Marka Kaydında tanımlanmamıştır. Lütfen Marka Kaydı seçeneklerinden bir marka seçin.", "severity": "ERROR", "categories": [] }, { "code": "18320", "message": "Ana görsel eksik veya yanlış. Gizlemeyi kaldırmak için lütfen uyumlu bir görsel gönderin. Ayrıca ürün görseli gerekliliklerine de bakın.", "severity": "ERROR", "categories": [ "MISSING_IMAGE" ], "enforcements": { "actions": [ { "action": "SEARCH_SUPPRESSED" } ], "exemption": { "status": "NOT_EXEMPT" } } }, { "code": "18448", "message": "relevant_attributes olarak etiketlenen nitelikler eksik. Şu nitelikler için değer sağlayın: material, style, handbag_silhouette, closure.type", "severity": "WARNING", "attributeNames": [ "closure", "handbag_silhouette", "material", "style" ], "categories": [ "MISSING_ATTRIBUTE" ] } ], "offers": [], "fulfillmentAvailability": [ { "fulfillmentChannelCode": "DEFAULT", "quantity": 0 } ] }

@jlevers
Copy link
Owner

jlevers commented Dec 2, 2024

Are you running Item::deserialize() directly in your code? If so, you need to run json_decode($jsonString, true) on your JSON data before passing it to the deserialize method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants