Open fmichaut-diff opened 1 year ago
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
Not stale
I can reproduce this issue in 13.1.0,
product = shop.execute_shopify_api { ShopifyAPI::Product.find(id: 7084933120074) }
product.tags #=> "foo"
product.save
# shopify_api-13.1.0/lib/shopify_api/clients/http_client.rb:71:
# in `request': {"errors":{"product":"Required parameter missing or invalid"},
# "error_reference":"If you report this error, please include this id: 7f494072-d3f9-46ce-ac60-60a5848feed8."}
# (ShopifyAPI::Errors::HttpResponseError)
product.tags = ['foo']
product.save # success
The ShopifyAPI::Order
object has a very similar issue with tags
(perhaps exactly the same issue). It is reproducible in 13.1.0 using the same steps.
Issue summary
When we access
product.tags
it returns a string of comma separated tags. When we save the product, it is required to set thetags
to an array of tags.This means that fetching a product and saving it without touching the tags results in an error :
shopify_api
version: 13.0.0Expected behavior
The object returned by
find
or similar fetching methods should be in a state where they can be saved without the user having to map some fields (that he might not even be touching) in a different format.Actual behavior
If you don't map the
tags
field from string to array, you can't save the product.Steps to reproduce the problem