highsidelabs / walmart-api-php

PHP SDK for Walmart's Marketplace Partner, Content Provider, and 1P Supplier APIs.
https://highsidelabs.co
BSD 3-Clause "New" or "Revised" License
22 stars 19 forks source link

De-serializing into a `TaxonomyResponseDTO` object fails to populate category/sub-category attributes #4

Closed jlevers closed 1 year ago

jlevers commented 1 year ago

It seems that de-serializing into a TaxonomyResponseDTO object fails to populate category/sub-category attributes when fetching the Marketplace department list from the Utility API. We've been able to determine that it's caused by the Category/Subcategory attribute maps not pointing to the correct key in the API response data (as well as missing a couple). Not sure if a new DTO object needs to be created for that specific endpoint.

Originally posted by @brysonreece in https://github.com/highsidelabs/walmart-api-php/issues/2#issuecomment-1634742321

jlevers commented 1 year ago

@brysonreece, could you give me a real (anonymized, if necessary) payload that's failing to be deserialized into TaxonomyResponseDTO correctly? It'll make debugging this issue a lot easier.

jlevers commented 1 year ago

@brysonreece, could you give this another try with version v0.5.0? I made some significant changes to how the library chooses which model to use for deserialization, and there's a good chance this will be resolved as a result.

brysonreece commented 1 year ago

My apologies, I was out the last few weeks so missed the discussion --

I can confirm that upgrading to ^0.5.0 fixes the issue, as well as #2!

Thanks for all the help!