Skip to content

Accessing the arguments property on a ShopifyAPI::Event object returns a Sorbet TypeError #1152

@amoughnie

Description

@amoughnie

Issue summary

Accessing the arguments property on a ShopifyAPI::Event object returns a Sorbet TypeError due to a mismatch between the auto-generated type on the ShopifyAPI::Event class and what gets returned in the body of the response

  • shopify_api version: 12.5.0
  • Ruby version: 2.7.0
  • Operating system: macOS
[43] pry(main)> event = ShopifyAPI::Event.all.first
=> #<ShopifyAPI::Event:0x0000ffff9fd8f640
 @aliased_properties={},
 @arguments=["News"],
 @author="Shopify",
 ...
[44] pry(main)> event.arguments           
TypeError: Return value: Expected type T.nilable(String), got type Array with value ["News"]

Expected behavior

ShopifyAPI::Event.all.first.arguments should return an array of arguments

Actual behavior

ShopifyAPI::Event.all.first.arguments returns a Sorbet type error: TypeError: Return value: Expected type T.nilable(String), got type Array with value ["News"]

Steps to reproduce the problem

  1. retrieve an Event object through the auto-generated REST API resource class: event = ShopifyAPI::Event.all.first
  2. try to access the arguments property: event.arguments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions