ToonToJson
Convert a TOON file into JSON.
Parses a TOON (Token-Oriented Object Notation) document and converts it to JSON. Supports TOON 2.0 features emitted by JsonToToon:
- indentation-based structure
- primitive arrays (inline)
- tabular arrays
- list arrays
- objects and arrays as list items
- canonical primitives (true/false/null/numbers)
yaml
type: "io.kestra.plugin.serdes.json.ToonToJson"Examples
Convert a TOON file to JSON.
yaml
id: toon_to_json
namespace: company.team
tasks:
- id: create_toon
type: io.kestra.plugin.core.storage.Write
extension: toon
content: |
products[2]{id,name,price}:
1,Apple,1.2
2,Banana,0.9
metadata:
category: fruits
country: France
- id: to_json
type: io.kestra.plugin.serdes.json.ToonToJson
from: "{{ outputs.create_toon.uri }}"
Properties
from *Requiredstring
Source TOON file URI
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
charset string
Default
UTF-8The name of a supported charset
Default value is UTF-8.
Outputs
uri string
Format
uriURI of the resulting JSON file
Metrics
records counter
Number of records parsed