JSONMissing Section
Ensures that every section type referenced by a JSON template (templates/*.json) or a section group (sections/*.json) refers to a section file that exists in the theme's sections directory.
Each entry in the top-level sections object of these files has a type property. That type must resolve to a sections/<type>.liquid file in the theme. Shopify runs the same validation when a theme is uploaded or published, so this check surfaces the problem while you're developing the theme.
The following section types are exempt from this check, because Shopify provides default files for them:
apps_blocks
Section entries that don't have a type property are skipped. The type property at the top level of a section group file, such as header or footer, isn't a section reference, so it isn't checked.
Anchor to ExamplesExamples
The following examples contain code snippets that either fail or pass this check.
Anchor to ✗ Fail✗ Fail
In the following example, the JSON template file references a section type that doesn't exist. There's no corresponding featured-collection.liquid file in the sections directory for the theme:
templates/index.json
Anchor to ✗ Fail✗ Fail
In the following example, the section group file references a section type that doesn't exist. There's no corresponding announcement-bar.liquid file in the sections directory for the theme:
sections/header-group.json
Anchor to ✓ Pass✓ Pass
In the following example, the JSON template file references a section type that exists in the sections directory for the theme:
templates/index.json
sections/featured-collection.liquid
Anchor to OptionsOptions
The following example contains the default configuration for this check:
| Parameter | Description |
|---|---|
enabled | Whether this check is enabled. |
severity | The severity of the check. |
Anchor to Disabling this checkDisabling this check
Disabling this check isn't recommended. A theme that references a section file that doesn't exist is rejected when it's uploaded or published.