Shopify / shopify-api-ruby

ShopifyAPI is a lightweight gem for accessing the Shopify admin REST and GraphQL web services.
MIT License
1.06k stars 473 forks source link

Fix CustomerAddress.all returning empty array #1192

Closed cdmwebs closed 1 year ago

cdmwebs commented 1 year ago

Description

Fixes #1018, #970

When fetching CustomerAddresses, the results are returned as addresses. This PR adds json_response_body_name to the class and updates tests.

How has this been tested?

Assertions added to count the returned results.

Checklist:

cdmwebs commented 1 year ago

Upon further review, this isn't going to work. The keys are different between Customer and CustomerAddress. When fetching a Customer, the key is customer_addresses. When fetching CustomerAddress, it's address.

cdmwebs commented 1 year ago

Looking for comments here. If this makes sense, I'll update the other API versions as well.

nelsonwittwer commented 1 year ago

Thanks for your contributions here! Unfortunately, we won't be able to use them as written as these resources are generated from a schema. Having said that, we can take this fix and apply it at the root layer so we don't regenerate these resources and lose your work.

We have plans to open source that REST resource generation logic to enable the community to be more proactive with these fixes, but for now we'll ask for a little more time as we make this fix. We have resources dedicated to closing out open issues, so it shouldn't be too much longer!