Describe the bug
Hi! Another rust user here, attempting to parse some Cargo.tomls. I have found that empty arrays (ex. my-feature = []) as required in the features table do not appear in the parsed output.
Thank you for the tool! 🙂
Version of yq: v4.52.5
Operating system: linux_amd64
Installed via: download via github release
Input TOML
Cargo.toml:
[package]
name = "my-package"
version = "0.1.0"
edition = "2024"
authors = ["me <me@me.com>"]
[dependencies]
zerocopy = "1.0.0"
serde = { workspace = true }
[features]
my-feature = []
Command
The command you ran:
Actual behaviour
[package]
name = "my-package"
version = "0.1.0"
edition = "2024"
authors = ["me <me@me.com>"]
[dependencies]
zerocopy = "1.0.0"
serde = { workspace = true }
Expected behaviour
[package]
name = "my-package"
version = "0.1.0"
edition = "2024"
authors = ["me <me@me.com>"]
[dependencies]
zerocopy = "1.0.0"
serde = { workspace = true }
[features]
my-feature = []
Additional context
The whole features table disappears in the case where there are only features with empty arrays, but if you include a feature with a non-empty array, the table and the item appear, but not any items with empty arrays:
Example:
[package]
name = "my-package"
version = "0.1.0"
edition = "2024"
authors = ["me <me@me.com>"]
[dependencies]
zerocopy = "1.0.0"
serde = { workspace = true }
[features]
my-other-feature = []
my-feature = ["my-other-feature"]
Results:
> yq '.' example.toml -o toml
[package]
name = "my-package"
version = "0.1.0"
edition = "2024"
authors = ["me <me@me.com>"]
[dependencies]
zerocopy = "1.0.0"
serde = { workspace = true }
[features]
my-feature = ["my-other-feature"]
I did also confirm that empty arrays at top-level are parsed, so seems to be specific to empty arrays within tables.
Describe the bug
Hi! Another rust user here, attempting to parse some
Cargo.tomls. I have found that empty arrays (ex.my-feature = []) as required in thefeaturestable do not appear in the parsed output.Thank you for the tool! 🙂
Version of yq: v4.52.5
Operating system: linux_amd64
Installed via: download via github release
Input TOML
Cargo.toml:
Command
The command you ran:
Actual behaviour
Expected behaviour
Additional context
The whole
featurestable disappears in the case where there are only features with empty arrays, but if you include a feature with a non-empty array, the table and the item appear, but not any items with empty arrays:Example:
Results:
I did also confirm that empty arrays at top-level are parsed, so seems to be specific to empty arrays within tables.