Skip to main content

AppBlockMissingSchema

Makes sure schema definition is present for app blocks in theme app extensions.


The following examples contain code snippets that either fail or pass this check.

<footer className="footer">
{% for block in section.blocks %}
{% case block.type %}
{% when 'link' %}
<div className="link" {{ block.shopify_attributes }}>
{{ block.settings.linktext | link_to: block.settings.linkurl }}
</div>
{% when 'custom-text' %}
<div className="text" {{ block.shopify_attributes }}>
{{ block.settings.custom-text-field }}
</div>
{% endcase %}
{% endfor %}
</footer>

<footer className="footer">
{% for block in section.blocks %}
{% case block.type %}
{% when 'link' %}
<div className="link" {{ block.shopify_attributes }}>
{{ block.settings.linktext | link_to: block.settings.linkurl }}
</div>
{% when 'custom-text' %}
<div className="text" {{ block.shopify_attributes }}>
{{ block.settings.custom-text-field }}
</div>
{% endcase %}
{% endfor %}
</footer>

{% schema %}
{
"name": "Footer",
"max_blocks": 8,
"blocks": [
{
"type": "link",
"name": "Link",
"settings": [
{
"id": "linkurl",
"type": "url",
"label": "URL link"
},
{
"id": "linktext",
"type": "text",
"label": "Link text"
}
]
},
{
"type": "custom-text",
"name": "Custom Text",
"settings": [
{
"id": "custom-text-field",
"type": "textarea",
"label": "Text"
}
]
}
]
}
{% endschema %}

AppBlockMissingSchema:
enabled: true
severity: error
ParameterDescription
enabledWhether this check is enabled.
severityThe severity of the check.

Anchor to Disabling this checkDisabling this check

Disabling this check isn't recommended.


Was this page helpful?