Shopify Template Schema
A tool for converting Shopify schemas into a JSON schema for templates.
Installation
Yarn:
yarn add shopify-template-schema
Usage
Shopify template schema will only create a schema for your templates. It won't valid them.
If your using Visual Studio Code we recommend using the json schema setting, like this:
{
"json.schemas": [
{
"fileMatch": ["templates/*.json"],
"url": "./template.schema.json"
},
{
"fileMatch": ["config/settings_schema.json"],
"url": "./config/settings_schema.schema.json"
},
{
"fileMatch": ["config/settings_data.json"],
"url": "./config/settings_data.schema.json"
},
{
"fileMatch": ["locales/*.json"],
"url": "./locale.schema.json"
}
]
}
Running from command line
You can run shopify-template-schema
directly from the CLI with a variety of options.
Here's how you would run it if the current directory isn't the a shopify project.
shopify-template-schema path/to/shopify-project
To view all options run:
shopify-template-schema -h