Shopify / Shopify/theme-tools

`ValidSchema` reports incorrect validation error when block in preset is disabled

Open
#748 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
234
Forks
92
Avg merge
1d 3h
Merged PRs (30d)
6

Description

Describe the bug
I'm copying some json from a template over to some schema presets and getting a theme check ValidSchema error with the wrong message.

Source

// sections/test.liquid

{% schema %}
{
  "name": "Test",
  "blocks": [{ "type": "@theme" }],
  "presets": [
    {
      "name": "Preset",
      "blocks": {
        "button": {
          "type": "button",
          "disabled": true
        }
      }
    }
  ]
}
{% endschema %}

Expected behaviour
"disabled": true is reported as invalid.
Theme Check flags a more useful error.

For what it's worth while I think this should be flagged as invalid, it is actually accepted by the platform, despite being useless.

Actual behaviour
The entire "blocks" value under the "Preset" preset throws an ValidSchema error with the message in the screenshot

Image

Debugging information

  • OS: macOS
  • OS Version: Sequoia 15.2
  • Theme Check Version: Unknown, according to CLI. I have @shopify/cli@3.74.0 installed though so whichever version is used by that

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the ValidSchema error using the sections/test.liquid example and inspect how the preset's blocks value is validated. Confirm that the diagnostic points specifically to "disabled": true rather than reporting the entire blocks value, then verify the corrected message with the same theme check.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.