Skip to content
Select theme
Light
Dark
Auto
Select language
English
فارسی

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.

SchemaDescribes
theme.schema.jsontheme.yaml, the manifest.
section.schema.jsonA sections/*.yaml file.
settings-document.schema.jsonThe merchant’s saved settings and layout, as a theme receives them.
render-context.schema.jsonWhat a theme fetches per request: the shop, the route, the settings and the API key.
common.schema.jsonShared definitions: handles, localized text, setting types.
SchemaDescribes
envelope.schema.jsonThe body of every webhook delivery.
catalog.schema.jsonThe machine-readable list of topics: each one’s scope and payload fields.

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.json
contract: theme/v1
id: golnar

For 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:

Terminal window
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/*.yaml

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.