Metafields type vs value_type breaks the liquid json function
jeremygottfried opened this issue · comments
Jeremy Gottfried commented
I followed the directions to migrate to "type" instead of "value_type" for Shopify metafields.
https://shopify.dev/apps/metafields/migration
After switching, I can no longer transform metafields to json in liquid.
This code has always worked:
{{ product.metafields.merch | json }}
Old API code (works):
{
key: 'preview_image',
value: JSON.stringify({
src: previewImage.url,
contentType: previewImage.contentType,
}),
value_type: "json_string",
namespace: "merch",
}
New API code (breaks liquid):
{
key: 'preview_image',
value: JSON.stringify({
src: previewImage.url,
contentType: previewImage.contentType,
}),
type: "json",
namespace: "merch",
}