JSON formatting issue
elliottmejia opened this issue · 4 comments
elliottmejia commented
After hitting save, I'm seeing this:
{ "type": "image_picker", "id": "image-preview", "label": "Image preview" }, { "type": "text", "id": "block-title", "label": "Title" }, {
instead of this:
{ "type": "image_picker", "id": "image-preview", "label": "Image preview" }, { "type": "text", "id": "block-title", "label": "Title" },
panoply commented
Hey @Elliottmeija did you figure out the issue here?
elliottmejia commented
I closed the issue because unfortunately Github reformatted the JSON, which
is hilarious, but no.
Shopify, specifically, doesn’t like json out of this format:
},
{
However, prettify defaults to this format:
},{
…On Thu, Nov 24, 2022 at 9:52 AM ΝΙΚΟΛΑΣ ***@***.***> wrote:
Hey @Elliottmeija <https://github.com/Elliottmeija> did you figure out
the issue here?
—
Reply to this email directly, view it on GitHub
<https://github.com/panoply/prettify/issues/36#issuecomment-1326738325>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACDY4GGADNPDIJKK33OBF4TWJ6TNFANCNFSM6AAAAAASKSOKEY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
panoply commented
You need to adjust the beautification rules, specifically by setting json.braceAllman
to true
. Shopify JSON structures don't necessarily require a specific format, any valid JSON will do. If Shopify recommends expanded structures, then it is only a recommendation, grain of salt it..
elliottmejia commented
Yeah, totally understand it’s just a warning, but it’s something I like
clearing and I personally prefer multi-line format.
Thank you for the tip!
…On Thu, Nov 24, 2022 at 9:59 AM ΝΙΚΟΛΑΣ ***@***.***> wrote:
You need to adjust the beautification rules, specifically by setting
json.braceAllman to true. Shopify JSON structures don't necessarily
require a specific format, any valid JSON will do. If Shopify recommends
expanded structures, then it is only a recommendation, grain of salt it..
—
Reply to this email directly, view it on GitHub
<https://github.com/panoply/prettify/issues/36#issuecomment-1326742930>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACDY4GHNQE4NBRMHUUZYE4DWJ6UJNANCNFSM6AAAAAASKSOKEY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>