JSON Schemas
Every structure Kaladan exchanges outside GraphQL is described by a JSON Schema
(draft 2020-12), published at the address in its own $id. Point your editor at
one and it checks your file as you type; run it in CI and a broken manifest never
reaches review.
Themes · theme/v1
Section titled “Themes · theme/v1”| Schema | Describes |
|---|---|
theme.schema.json | theme.yaml, the manifest. |
section.schema.json | A sections/*.yaml file. |
settings-document.schema.json | The merchant’s saved settings and layout, as a theme receives them. |
render-context.schema.json | What a theme fetches per request: the shop, the route, the settings and the API key. |
common.schema.json | Shared definitions: handles, localized text, setting types. |
Webhooks · webhooks/v1
Section titled “Webhooks · webhooks/v1”| Schema | Describes |
|---|---|
envelope.schema.json | The body of every webhook delivery. |
catalog.schema.json | The machine-readable list of topics: each one’s scope and payload fields. |
In your editor
Section titled “In your editor”The YAML language server (built into VS Code’s YAML extension and most other editors) reads a comment on the first line:
# yaml-language-server: $schema=https://kaladan.dev/contracts/theme/v1/theme.schema.jsoncontract: theme/v1id: golnarFor a section file, use section.schema.json the same way.
Any draft 2020-12 validator works. check-jsonschema
reads YAML and fetches the schema and its references from their addresses:
pipx run check-jsonschema \ --schemafile https://kaladan.dev/contracts/theme/v1/theme.schema.json \ theme.yaml
pipx run check-jsonschema \ --schemafile https://kaladan.dev/contracts/theme/v1/section.schema.json \ sections/*.yamlStability
Section titled “Stability”A schema’s address names its contract version. Within v1, a schema only
grows: new optional properties, never a new requirement or a narrower type. A
breaking change would be v2, published beside v1, never in its place.