# JSON Schema

> The formal definition of a lesson file, for validators and your own tools.

The lesson format has a [JSON Schema](https://json-schema.org) (draft 2020-12):

```text
https://learn.ninja/schema/lesson.schema.json
```

It's also bundled with the skill at `schema/lesson.schema.json`. Don't add a `$schema` key to the lesson itself: the format doesn't allow extra fields.

## What the schema can't check

Some rules span several fields, so the schema can't express them. The [CLI's `validate`](https://learn.ninja/docs/reference/cli#validate) and the [API](https://learn.ninja/docs/reference/api) check these too:

* The first kata is a concept; each concept is followed by two to four question katas.
* Ids are unique, and every reference points to something real.
* Every wrong option has feedback.
* Formulas render, and HTML visuals contain no scripts or external URLs.

See the full list in [Lesson format](https://learn.ninja/docs/lessons/lesson-format#rules-the-checker-enforces).
