Data workflow guides

Convert JSON to TOON and verify the decoded values

·

Use JSON to TOON to send structured data in an indented text format with explicit array lengths. For repeating records, the TOON table lists the field names once. Read the saved result back to confirm that the original data types made the trip.

JSON to TOON

Encode an inventory object as TOON

Paste the example into JSON input. Choose Comma under TOON delimiter and select Convert to TOON. Both items have the same three fields with primitive values, so the encoder writes a single tabular header. The document also has a separate next field.

JSON input with numbers, strings, booleans and null
{
  "items": [
    {"code": "007", "ready": true, "count": 2},
    {"code": "010", "ready": false, "count": 0}
  ],
  "next": null
}

RFC 8259, the JSON data interchange formatTOON syntax cheatsheet

Change the delimiter and compare the output

The comma output uses the header items[2]{code,ready,count}:. Its rows begin with the quoted codes "007" and "010". The booleans and numbers have no quotes, and next remains null.

Choose Pipe and convert the same source again. Look for items[2|]{code|ready|count}:. The pipes separate columns and the marker inside the brackets tells the reader which delimiter to use.

Expected TOON with the pipe output delimiter
items[2|]{code|ready|count}:
  "007"|true|2
  "010"|false|0
next: null

Official TOON format specificationTOON syntax cheatsheet

Compare the decoded values with the original JSON

Download converted.toon and open the saved file in TOON Validator. After validation, compare the two records in Decoded JSON. The first code is "007", its count is the number 2, the second ready value is false, and next is null.

If you edit the TOON, preserve the quotes for identifiers and keep arrays in their intended order. Adjust data types in the source JSON when you want a conversion you can reliably reproduce.

RFC 8259, the JSON data interchange formatOfficial TOON format specification

Common questions

Must every array use a tabular layout?

TOON can use inline arrays for primitive values and indented lists for mixed arrays. The data shape determines the layout.

What if an identifier exceeds the safe integer range?

Put the identifier in quotes in the source JSON. Convert it as a string so the digits stay exact.

Sources

Put it into practice.

Related guides