Table and array of tables
Input
title = "My App"
[owner]
name = "Ada"
[[servers]]
host = "alpha"Output
title: My App
owner:
name: Ada
servers:
- host: alphaThe [owner] table becomes indented, and [[servers]] becomes a sequence entry.
This conversion goes from the more explicit format to the more expressive one, so nothing structural is lost. TOML tables become indented YAML mappings, and arrays of tables become YAML sequences of mappings.
It is the direction you want when a tool expects YAML, most CI systems and Kubernetes tooling, but your configuration is authored in TOML.
Each example below is executed against this tool by the test suite, so what you see is what the tool actually produces.
Input
title = "My App"
[owner]
name = "Ada"
[[servers]]
host = "alpha"Output
title: My App
owner:
name: Ada
servers:
- host: alphaThe [owner] table becomes indented, and [[servers]] becomes a sequence entry.
The details that decide whether a conversion is correct, and where information can be lost without any error being raised.
Migrate a YAML config to TOML.
Turn TOML config into JSON, with dates normalised to ISO 8601.
Turn JSON into readable YAML for config files and manifests.
Turn a single YAML document into JSON, with limits on what carries over.