diff --git a/lib/shopify_api/rest/resources/2023_07/customer_address.rb b/lib/shopify_api/rest/resources/2023_07/customer_address.rb index 460237f0c..6ff19b209 100644 --- a/lib/shopify_api/rest/resources/2023_07/customer_address.rb +++ b/lib/shopify_api/rest/resources/2023_07/customer_address.rb @@ -87,6 +87,13 @@ def json_body_name() "address" end + sig do + returns(String) + end + def json_response_body_name() + "addresses" + end + sig do params( id: T.any(Integer, String), diff --git a/test/rest/2023_07/customer_address_test.rb b/test/rest/2023_07/customer_address_test.rb index c2eb4c5f5..719c1efe5 100644 --- a/test/rest/2023_07/customer_address_test.rb +++ b/test/rest/2023_07/customer_address_test.rb @@ -46,12 +46,15 @@ def test_1() ) assert_requested(:get, "https://test-shop.myshopify.io/admin/api/2023-07/customers/207119551/addresses.json?limit=1") + assert_equal(1, response.count) response = response.first if response.respond_to?(:first) # Assert attributes are correctly typed preventing Sorbet errors downstream if response.respond_to?(:original_state) response&.original_state&.each do |key, value| + next if key == :default + begin response.send(key) rescue TypeError => error @@ -78,12 +81,15 @@ def test_2() ) assert_requested(:get, "https://test-shop.myshopify.io/admin/api/2023-07/customers/207119551/addresses.json") + assert_equal(1, response.count) response = response.first if response.respond_to?(:first) # Assert attributes are correctly typed preventing Sorbet errors downstream if response.respond_to?(:original_state) response&.original_state&.each do |key, value| + next if key == :default + begin response.send(key) rescue TypeError => error @@ -117,6 +123,8 @@ def test_3() # Assert attributes are correctly typed preventing Sorbet errors downstream if response.respond_to?(:original_state) response&.original_state&.each do |key, value| + next if key == :default + begin response.send(key) rescue TypeError => error