Edit a JSON Schema model
A JSON Schema model opens in the outline: the model tree, edited in place. Each row shows a name, a JSON type and badges, and you change the name, the type and whether a property is required right on the row. The panel on the right holds two tabs: Properties, the form for everything else, and Source, the JSON the model exports to.
JSON Schema has no diagram notation, so a JSON Schema model has no canvas and no Form / Canvas switch. The model’s left navigation shows no Diagrams entry, and the panel no Diagram settings tab, unless the model already holds a diagram.
Prerequisites
Section titled “Prerequisites”- A JSON Schema model you can edit. To create one, choose JSON Schema on the Metamodel step of the Create model dialog; see Create or import your first model.
- The model open in the Model editor.
What the outline shows
Section titled “What the outline shows”The top level of the outline holds Documents and Folders. A Document stands for one JSON Schema document. A Folder groups Documents and other Folders. Expanding a Document also expands its root schema, the schema at the top of the document, so you see its rows at once. A model imported from several files holds one Document per file, in Folders that repeat the files’ directories; see Import a JSON Schema.
Each row reads from left to right:
- The name: a property’s name, a definition’s name, or for a schema on its own (such as a root schema or a variant) its title.
- The type, in monospace:
string,object, orstring, nullfor a schema that allows several types. A schema with no type reads any, in italics: it accepts any JSON value. - Badges: required on a required property, the format a string must follow (such as
email),enum(3)for a list of allowed values, andconstfor one fixed value.
A property and its schema are one row: email string is the property email holding a string schema. The properties
of an object property sit directly under its row, and the schema of an array’s items is a row named Items.
Keywords that only constrain a value, such as a minimum length or a pattern, are not rows. You edit them in the
Properties form.
Some rows say what kind of thing they are:
- $defs is the schema’s definitions: a section under a rule, after the schema’s other rows, with a count such as
3 definitions. A definition row reads like a property row (
Address object), and its badge says how often it is used: unused, 1 use or 2 uses. Select the badge to open the Used by list, and select a row there to go to it. - A reference chip, with a link icon and a definition’s name, stands in place of a type where a schema is a
reference to a definition. Select the name, or press Cmd+G (Ctrl+G on Windows and Linux) or F12, to go to the
definition. The chevron on the chip shows the definition’s rows one level deep, tinted and read-only. Selecting one
of those rows takes you to it inside the definition, where you can edit it. A definition in another Document reads
with that Document’s name in front, such as
address.json:Address. Where another Document has the same name, the Folder path comes first, such asv1/types.json:Address. - An external reference points at a schema outside the model. Its chip shows the end of the locator, such as
common.json#/$defs/Money; point at it to see the whole locator. - recursive marks a definition that contains itself, where the outline would otherwise expand it again.
- All of, Any of and One of are one row per composition, with its number of variants (2 variants). Expand the row to see the variants.
- If / Then / Else groups the three conditional keywords in one block. An arm that holds nothing reads empty.
trueorfalsein place of a type means the keyword holds one of JSON Schema’s two built-in schemas, for example Unevaluated propertiesfalse.- choose type…, in amber, marks a place that must hold a schema and holds none yet. Where a schema is optional, an empty place shows a dash.

To find a row, type part of its name in the search box above the outline. Cmd+F (Ctrl+F) puts the cursor there.
Edit on the row
Section titled “Edit on the row”A change you make on a row is saved as soon as you confirm it. There is no separate save.
- Rename: double-click the name, or press F2. Type the new name and press Enter to confirm, or Escape to cancel. On a schema row, such as a root schema or a variant, the name you type is the schema’s title.
- Type: select the type to open the type picker, and select a type to replace the current one. To allow several
types, such as
stringandnull, tick Several first: each type you select is then added or removed. The last cell, any, removes the type. The search at the top (Search types) narrows the choice, and Enter takes the first match. - Required: on a property row, select the required badge to make the property optional. An optional property shows a dashed required badge when you point at the row or reach it with the keyboard. Select it to make the property required again.
The type on the row changes the JSON type only. To make a schema a reference to a definition or to a schema outside the model, use the panel on the right; see Choose what a schema holds.
From the keyboard, Tab moves from the name to the type and to required, then on to the next row. Shift+Tab moves back. On a focused type, Ctrl+Space opens the type picker, and typing a letter opens it with that letter already in the search.
Create rows
Section titled “Create rows”Point at a row to show its +. Its menu lists what you can create there, with the row’s main child in bold. Select a row and press Shift+Enter to create that main child without opening the menu.
On a schema row, the menu offers:
- Property and Pattern property, on an object schema or a schema with no type. Property is the main child.
- Items, on an array schema, as the main child.
- allOf, anyOf, oneOf and if / then / else.
- Definition.
- More, with everything else the schema can hold, such as Not. An entry that does not fit the schema’s type, such as Items on an object schema, sits here too.
A property row whose schema is an object offers that schema’s entries first, so the + on an object property creates properties inside it. On a composition row, the + adds a variant (Add variant). On a Folder row, it offers Create Document (the main child) and Create Folder. Create element, below the last row of the outline, offers the same two at the top level. A model with no content yet shows Get started with your model, with a button for each.
Add a property
Section titled “Add a property”-
Select the schema the property belongs to, such as the root schema, and press Shift+Enter. You can also select Property in the row’s + menu. A new row appears where the property will go, with an empty name.
-
Type the name, such as
email, and press Tab. ModelDesk creates the property as astring, and the keyboard moves to its type. -
To give it another type, type its first letters and press Enter. For example,
intand Enter setsinteger. -
Press Tab to reach required, and press Space to make the property required.
On the new row, Enter creates the property and stays on it, and Shift+Tab does the same. Escape, or moving elsewhere, discards the new row. A row with an empty name creates nothing. If ModelDesk refuses the create, it says why at the bottom of the outline and puts the row back with what you typed, so you can correct the name.
What a new row starts as
Section titled “What a new row starts as”- A property, a pattern property, a definition, a Document and a Folder first ask for a name, on a new row as above.
- A new property, pattern property or definition starts as
string. - A new Document comes with its root schema, which starts as
object. - Items, Add variant and if / then / else create an empty schema at once, with no type, and select it. Choose its type or a reference in the panel on the right. if / then / else fills the first of the three that is still empty.
Choose what a schema holds
Section titled “Choose what a schema holds”The panel on the right is where you decide what a property, a definition, an item schema or a variant holds: a schema written in place, a reference to a definition, or a reference to a schema outside the model. Select a row and press Enter to move to that field; Escape takes you back to the row.
For a property, a pattern property or a definition, the field is called Type and sits in the row’s form. For a schema that stands in a keyword, such as Items or a variant of All of, the field sits at the top of the form, named after the keyword.
The field’s label row ends in a switch between Schema and Reference. Switching shows the other side and changes nothing until you choose something there.
- On the Schema side, the Type field opens the type picker: the types, any, and under Built-in the two
built-in schemas
true(Every value is valid.) andfalse(No value is valid.). Choosingfalsefor Additional properties, for example, allows no properties beyond the ones the schema names. - On the Reference side, a list shows the definitions of the same Document, each with its type and how often
it is used, such as
object · 2 uses. To point at a schema outside the model, type its address, such ascommon.json#/$defs/Address, and choose Use as external reference. ModelDesk checks the address as you type.
Only definitions in the same Document are offered, because only those are exported as a $ref.
Point a property at a definition
Section titled “Point a property at a definition”-
Select the property row and press Enter. The Type field in the Properties tab has the focus.
-
In the field’s label row, switch from Schema to Reference.
-
Select the definition in the list.
-
If the property’s schema holds more than its type, ModelDesk asks Replace inline schema? and lists the settings that would be lost. Select Replace to go ahead, or Cancel to keep the schema. Cancel has the focus, and Escape answers it too.
The row now shows the definition’s chip. Every choice in this field is saved at once, together with any edits the form was still holding.
While the field holds a definition, it shows the definition’s chip with its type and uses, and an icon that goes to the definition (Go to definition). An external reference that is a web address has an icon that opens it (Open in new tab). Where a schema is required and the field holds nothing, a line under it says A value is required.
A row that reaches a definition through a reference shows only this field in the panel, with Go to definition.
The definition is shared by every row that uses it, so you edit it at its own row in $defs.
The rest of the form
Section titled “The rest of the form”Under the field come the other settings of the schema, such as Metadata and Validation. Groups that do not apply to the schema’s type, such as String constraints on an object, start collapsed, and open when one of their fields holds a value. Changing the type opens the matching groups straight away. Select Save changes, or press Cmd+S (Ctrl+S), to save what you changed in the form.
Format, the format a string must follow such as date or email, is the first field under String
constraints. Validation holds Enum and Const.

Turn a schema into a definition and back
Section titled “Turn a schema into a definition and back”Extract to definition moves a schema written in place into a definition, and points the row at it.
-
Select the row that holds the schema, such as a property
address object. -
Press Cmd+Shift+E (Ctrl+Shift+E), or right-click the row and choose Extract to definition. In the panel, the field’s ⋯ menu offers the same.
ModelDesk creates a definition named after the row in the $defs of the nearest schema that encloses it, moves the
schema there, and the row shows the new definition’s chip. Where $defs already holds that name, a number is added,
such as address2.
Inline definition does the reverse for a row that shows a definition’s chip: right-click the row, or open the field’s ⋯ menu, and choose Inline definition. ModelDesk copies the definition’s schema into the row and keeps the definition. Where other rows still use it, the Inline definition dialog says how many; select Inline to go ahead. Those rows keep pointing at the definition.
Reorder rows and change a composition
Section titled “Reorder rows and change a composition”To move a row among its siblings, press Alt+↑ or Alt+↓ (Option+↑ or Option+↓ on a Mac), or right-click it and choose Move up or Move down. A row that is already first or last cannot move further, and the menu says so. You can also drag a row to a new place among its siblings: a line shows where it will land.
To copy or move rows, right-click a row and choose Copy or Cut, then right-click the row to put them under and choose Paste. On a row that shows a schema’s properties, such as a definition, the pasted rows join those properties.
To turn a composition into another, select its keyword, such as All of, and choose another, such as One of. Every variant moves to it. The row’s right-click menu offers the same, as Change to One of.
Enter values of any type
Section titled “Enter values of any type”const, default, and each entry of enum and examples can hold any JSON value. Select the value to edit it in
place, and press Enter to keep it or Escape to cancel. The field reads what you type like this:
- A number,
true,falseornullis stored as that value. - Text in double quotes is stored as text, so
"01"stays the text01rather than the number 1. - Any other text is stored as you typed it.
A stored text that would read as a number or a literal is shown in quotes, so what you see is what is stored. An array
or object shows as JSON on one line, such as ["2", "3"]. Select it to open its JSON, and point at it to see all of a
long value.
To start a value as an array or object, use Edit as JSON: the {} button at the right end of the field, which
appears when you point at the field or reach it with the keyboard. Select it again to go back. While the JSON is not
valid, the field says Invalid JSON.
Check the JSON in the Source tab
Section titled “Check the JSON in the Source tab”Select Source in the panel, or press Cmd+. (Ctrl+.). The tab shows the model as its export reads, read-only, with the Format selector and the file name above it. The part that belongs to the selected row is highlighted and scrolled into view, and the tab updates about a second after a change is saved. Where the export cannot be written, the tab shows the message that says why instead of the document.
A model with several Documents exports one file per Document. The tab then shows the file that holds the selected row, and File replaces the file name. Choose another file under File to read it.
Select Properties to go back to the form.

Delete a row
Section titled “Delete a row”Select the row and press Shift+Delete or Shift+Backspace, or right-click it and choose Delete…. ModelDesk asks you to confirm.
Keyboard shortcuts
Section titled “Keyboard shortcuts”On a Mac, use Cmd where the table says Ctrl, except for Ctrl+Space.
| Keys | What it does |
|---|---|
| ↑ / ↓ | Move between rows |
| → / ← | Expand or collapse a row, or go to its parent |
| F2 | Rename the row |
| Enter | Move to the row’s field in the Properties form, or confirm what you are editing |
| Escape | Cancel an edit, go back from a field to its row, or discard a new row |
| Tab / Shift+Tab | Move through the name, type and required of a row, then on to the next or previous row |
| Ctrl+Space | Open the type picker on a focused type |
| Shift+Enter | Create the row’s main child |
| Alt+↑ / Alt+↓ | Move the row up or down among its siblings |
| Ctrl+Shift+E | Extract to definition |
| Ctrl+G or F12 | Go to the definition a reference chip points at |
| Ctrl+F | Put the cursor in the search box |
| Shift+Delete / Shift+Backspace | Delete the row, after you confirm |
| Ctrl+S | Save the Properties form |
| Ctrl+. | Show the Source tab |
If this goes wrong
Section titled “If this goes wrong”- Property is not at the top of the + menu. The schema’s type is not
object. Find Property under More, or set the type toobjectfirst. - A definition is missing from the list on the Reference side. The list offers the definitions of the same Document only.
- “Replace inline schema?” appears. Your choice would drop the settings it lists. Select Cancel to keep them.
- There is no canvas, and no Diagrams entry. JSON Schema has no diagram notation, so a JSON Schema model has no canvas, and shows Diagrams only when it already holds a diagram.
- A row cannot be renamed or edited. Preview rows under a reference chip and rows that belong to another model are read-only. Go to the definition, or to the model that holds the row.
Related pages
Section titled “Related pages”- Create or import your first model: create a JSON Schema model.
- Models, elements & properties: the elements and properties behind the rows.
- Export a model: download the JSON Schema the Source tab shows.
- Supported standards & formats: what ModelDesk can do with JSON Schema.