`ValidSchema` reports incorrect validation error when block in preset is disabled
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
Debugging information
- OS: macOS
- OS Version: Sequoia 15.2
- Theme Check Version: Unknown, according to CLI. I have
@shopify/[email protected]installed though so whichever version is used by that
Hey @david-w-shopify! I'm pretty sure the schema validation is behaving as intended here. The "blocks" attribute should be passed an array of objects, not a single object: https://shopify.dev/docs/storefronts/themes/architecture/blocks/theme-blocks/schema#presets
After chatting with David a bit I think there is a bug here. It's treating any non-valid attribute as a schema error (good!) but bubbling it up to a parent issue. We'll take a look at this.