Skip to content

Yaml Toml Converter API

POST https://api.findutils.com/api/tools/yaml-toml-converter/execute

Convert YAML to TOML 1.0 or TOML back to YAML. Mappings become tables, lists of mappings become arrays of tables, and scalar lists stay inline arrays. The YAML root must be a mapping because TOML has no top-level list. TOML has no null either: nulls is "drop" (default, the key is left out and reported) or "empty" (an empty string). Anchors, aliases and `<<` merge keys are resolved on load and written out in full. Comments are not preserved in either direction. Parse errors report the line and column.

Request body

application/json
  • input

    string required

    The YAML document or the TOML document to convert.

  • mode

    string optional

    Conversion direction. Default: yaml-to-toml. One of yaml-to-toml · toml-to-yaml. Default "yaml-to-toml".

  • nulls

    string optional

    yaml-to-toml: what to do with a null value. "drop" leaves the key out; "empty" writes "". Default: drop. One of drop · empty. Default "drop".

  • indent

    integer optional

    toml-to-yaml: YAML indentation width (1-8). Default: 2. Default 2.

  • sort_keys

    boolean optional

    Sort keys alphabetically at every level. Default: false (input order). Default false.

Example arguments

Verified
{
  "input": "title: demo\ndatabase:\n  host: localhost"
}