Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while parsing TOML file with an empty table #1935

Closed
elibroftw opened this issue Feb 4, 2024 · 1 comment
Closed

Error while parsing TOML file with an empty table #1935

elibroftw opened this issue Feb 4, 2024 · 1 comment
Labels

Comments

@elibroftw
Copy link
Contributor

Describe the bug

I'm using yq to parse Cargo.toml files. One of them has an empty dependencies table.

When supplying this file to yq, I get the following error

Version of yq: 4.40.5
Operating system: linux
Installed via: binary

Input TOML

Concise toml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less)

data1.yml:

[package]
name = "appName"
version = "0.1.0"
edition = "2021"

[dependencies]

Command

The command you ran:

yq '.package | has("version")' obscura-types/Cargo.toml

Actual behavior

Error: bad file 'Cargo.toml': error retrieving table [dependencies] value: %!w(<nil>)

Expected behavior

true

Additional context

Even if the TOML specifications don't allow empty tables, if rust/cargo supports it, then so should this tool, otherwise I'll use another one.

@elibroftw
Copy link
Contributor Author

Duplicate of #1924

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant