Skip to content

TOML parser does not support sub tables in arrays of tables #509

@pmeier

Description

@pmeier

To Reproduce

$ dasel version
v3.2.1
$ echo '
[[fruits]]
name = "apple"

[fruits.physical]
color = "red"
shape = "round"
' | dasel -i toml -o json
dasel: error: error reading input: conflicting types at path 'fruits': expected map

This is valid syntax:

Any reference to an array of tables points to the most recently defined table element of the array. This allows you to define sub-tables, and even sub-arrays of tables, inside the most recent table.

Expected behavior

{
  "fruits": [
    {
      "name": "apple",
      "physical": {
        "color": "red",
        "shape": "round"
      }
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions