Skip to content

Using "Evaluate All" to combine a series of TOML documents only includes the contents of the first #2624

@logancollins

Description

@logancollins

Describe the bug

I have a folder containing many TOML documents, which need to be combined into a single JSON document (by combining them into one array of objects).

If I run yq ea '[.]' -o json *.toml, the output document's root array only includes the contents of the first TOML document. If I instead use YAML documents for input and use yq ea '[.]' -o json *.yaml, the result I'd expect is output.

Version of yq: 4.52.4
Operating system: macOS Sequoia 15.7.3
Installed via: Homebrew

Input TOML

data1.toml

id = "Foobar"

data2.toml:

id = "Barbar"

Command
The command you ran:

yq ea '[.]' -o json *.toml

Actual behaviour

[
  {
    "id": "Foobar"
  }
]

Expected behaviour

[
  {
    "id": "Foobar"
  },
  {
    "id": "Barbar"
  }
]

Additional context

I don't think there is any inherent difference for TOML that I'm overlooking, but if I am, apologies!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions