You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! First of all, thank you so much for making and maintaining yq; I happily use your tool everyday and especially thank you for starting work on TOML support—see #1364 issue!
Issue: I noticed that yq breaks when parsing TOML nested array of tables with arrays (lol)—see Array of Tables section. Workaround: To work around, you can parse TOML with tomljson command, then pipe JSON to yq.
Version of yq: v4.35.1,...,v4.42.1
Operating system: Mac and Linux
Installed via: Homebrew and Docker
Input TOML
data1.toml:
[[fruits]]
name = "apple"
[[fruits.varieties]] # nested array of tablesname = "red delicious"
Command
The command you ran:
yq -ptoml -oyaml data1.toml
Actual behavior
Error: bad file 'data1.toml': cannot index array with 'varieties' (strconv.ParseInt: parsing "varieties": invalid syntax)
Expected behavior
fruits:
- name: applevarieties:
- name: red delicious
Additional context
I suspect this is a problem with yq because the tomljson command can handle data1.toml like the following shell session illustrates:
$ tomljson /dev/stdin <<'TOML' | yq -P[[fruits]]name = "apple"[[fruits.varieties]] # nested array of tablesname = "red delicious"TOML
fruits:
- name: apple
varieties:
- name: red delicious
Again, thank you for yq and please advise if I should do any other experiments.
The text was updated successfully, but these errors were encountered:
Describe the bug
Hi! First of all, thank you so much for making and maintaining yq; I happily use your tool everyday and especially thank you for starting work on TOML support—see #1364 issue!
Issue: I noticed that yq breaks when parsing TOML nested array of tables with arrays (lol)—see Array of Tables section. Workaround: To work around, you can parse TOML with tomljson command, then pipe JSON to yq.
Version of yq: v4.35.1,...,v4.42.1
Operating system: Mac and Linux
Installed via: Homebrew and Docker
Input TOML
data1.toml:
Command
The command you ran:
Actual behavior
Expected behavior
Additional context
I suspect this is a problem with yq because the tomljson command can handle data1.toml like the following shell session illustrates:
Again, thank you for yq and please advise if I should do any other experiments.
The text was updated successfully, but these errors were encountered: