Skip to main content

JSON

14 commands. Toolkit id ooa.json.

CommandWhat it does
Convert to JSON textWrite a value (Dictionary, List, table...) as JSON text.
Convert to tableTurn a JSON list of records into a table: each key becomes a column, each record a row.
Delete nodeRemove one value from JSON, found by its path (order.items[0]).
End sessionClose a JSON session, optionally saving its document to a file first.
Get node listRead the list found at a path, ready to go through with a Loop.
Get node valueRead one value from JSON by its path, such as order.items[0].sku; $..sku finds every sku, $.items[?(@.qty > 1)] the items with qty over 1.
Get several node valuesRead several values at once into a Dictionary, e.g. {"id": "order.id", "email": "customer.email"}, each turned into a type if you want.
Insert nodeAdd a value to JSON: a new key, or an item in a list at a position such as order.items[1].
Parse JSONRead JSON text into a Dictionary or a List.
Read JSON fileRead a JSON file into a Dictionary or a List.
Start sessionLoad JSON (text, a value or a file) once as a named session, so later steps read and change it without passing it along.
Update nodeChange one value in JSON, found by its path; a list there can be replaced or added to.
Validate JSONCheck JSON: that it is well written, that the paths you need are there and, if you give one, that it follows a JSON Schema.
Write JSON fileSave a value to a JSON file (written in one go, so a reader never sees half a file).