fix: "Type 'Null' is not a subtype of type 'List<dynamic>'" exception - #112
fix: "Type 'Null' is not a subtype of type 'List<dynamic>'" exception#112sebipirpi wants to merge 15 commits into
Conversation
… in retrieve_catalog_objects and batch_retrieve_catalog_objects response
|
@mtwichel can you please review this when you have time? |
|
@fabriziocacicia @BruceClark406 could you please take a look at this? |
mtwichel
left a comment
There was a problem hiding this comment.
Looks good, thanks for the contribution!
|
@mtwichel one of the checks fails because of a method that I didn't touch as far as I can tell, more specifically "_$BatchRetrieveCatalogObjectsRequestFromJson". The line length exceeds 80 characters where it's declared. Should I rename it? |
Looks like it just failed the formatter. Could you try running |
Done, thanks. |
|
@mtwichel is there anything else I can do on my part? From what I can see, this check has failed for other PRs as well. |
|
@mtwichel could you please take a look when you have time? |
Problem
When retrieving the images for catalog products, an exception is thrown because the "related_objects" field is not expected to be nullable. However, in my case, it is missing from the response entirely. This is reproducible via the Rest API as well, when sending a GET request http://connect.squareupsandbox.com/v2/catalog/object/{id} for an image for example.
Fix
Make the "related_objects" field nullable in the responses for "retrieve_catalog_objects" and "batch_retrieve_catalog_objects".