JSON
Open API responses, configuration files and any other JSON as a diagram.
Paste JSON or open a .json file and ToDiagram draws its structure: every object and array becomes a node, and every field becomes a row.
Example
{
"user": {
"id": 4812,
"name": "Dana Whitfield",
"plan": "pro"
},
"orders": [
{
"id": "A-1042",
"total": 138.5,
"paid": true
},
{
"id": "A-1057",
"total": 24.0,
"paid": false
}
]
}Open a JSON example in the editor
How JSON is drawn
- An object is a node. Its fields with plain values are rows in that node.
- A field that holds an object or an array shows a count, such as
{3 keys}or[2 items], and links to a node of its own. Click the button on the row to fold or unfold it. - Items of an array are named by their position, such as
orders[0]. - Values are colored by type: text, numbers,
true,falseandnull. A value that is a color, such as#FF0000, shows a swatch.
Good to know
- Comments are allowed, both
//and/* */. - A syntax error stops the diagram from updating. The status mark under the text editor turns red, and hovering it shows the error.
- Text that holds one JSON object or array per line opens as JSON Lines, even from a
.jsonfile.
Related
- Views and Fields: tree, table and chart views
- Edit on the Diagram: change values from the canvas
- JSON Schema: validate the document