JSON Schema
Validate a document against a JSON Schema, generate a schema from your data, and create mock data from a schema.
A JSON Schema describes what a document should look like: which fields it has, their types and which ones are required. Attach one to a document and the editor checks the document against it as you type.
JSON Schema is available for JSON, JSON Lines, YAML, CSV and XML documents. It is not available for Mermaid and ToDiagram documents.

Attach a schema
- Click JSON Schema in the bar under the text editor.
- Paste your schema, or click the first button under the editor to generate a schema from the current data.
- Click Apply Schema.
When the document does not match the schema, the JSON Schema button turns yellow with a warning sign. Hover it to read what is wrong.
To stop validating, open the dialog again and click Disable.
Tools in the dialog
The three buttons under the schema editor, from left to right:
| Button | What it does |
|---|---|
| Generate schema from current data | Writes a schema that matches the open document. A good starting point to edit by hand |
| Generate mock data from schema | Opens a new JSON tab filled with sample data that follows the schema |
| Resolve $ref references | Replaces every $ref in the schema with the definition it points to |
JSON Lines
A schema attached to a JSON Lines document describes one record, and every line is checked against it. See JSONL.
Saved with the document
The schema is part of the document. When you save the document to the cloud, the schema is saved with it.