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

Shop.tax_shipping wrong sorbet type #1271

Closed bgmat closed 6 months ago

bgmat commented 9 months ago

Issue summary

When you try to read the tax_shipping from a Shop you get this error: Return value: Expected type T.nilable(String), got type TrueClass

Return value: Expected type T.nilable(String), got type TrueClass
Caller: /app/app/test.rb:660
Definition: /usr/local/bundle/gems/shopify_api-13.4.0/lib/shopify_api/rest/resources/2023_10/shop.rb:183
/usr/local/bundle/gems/sorbet-runtime-0.5.11226/lib/types/configuration.rb:296:in `call_validation_error_handler_default'
/usr/local/bundle/gems/sorbet-runtime-0.5.11226/lib/types/configuration.rb:303:in `call_validation_error_handler'
/usr/local/bundle/gems/sorbet-runtime-0.5.11226/lib/types/private/methods/call_validation.rb:300:in `report_error'
/usr/local/bundle/gems/sorbet-runtime-0.5.11226/lib/types/private/methods/call_validation_2_7.rb:923:in `block in create_validator_method_medium0'

Expected behavior

We should not see this error because the tax_shipping type is boolean

Actual behavior

We get this error: Expected type T.nilable(String), got type TrueClass

Steps to reproduce the problem

shop = ShopifyAPI::Shop.all.first
shop.tax_shipping 
matteodepalo commented 9 months ago

Hi @bgmat thank you for reporting this issue, we've put it in our backlog and will let you know when we publish a fix.