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

Nested Arrays of Objects don't work #182

Open
justinliow opened this issue Apr 7, 2023 · 2 comments
Open

Nested Arrays of Objects don't work #182

justinliow opened this issue Apr 7, 2023 · 2 comments
Labels

Comments

@justinliow
Copy link

justinliow commented Apr 7, 2023

Example

 {
    "topLevel": [{
            "objectLevel": ["a", "b"],
            "arrayOfObjs": []
        },
        {
            "objectLevel": ["c"],
            "arrayOfObjs": [{
                "obj_a": "obj_a_val",
                "obj_b": "obj_b_val"
            }]
        }
    ]
}

should be represented in TOML as


[[topLevel]]
objectLevel = [ "a", "b" ]
arrayOfObjs = [ ]

[[topLevel]]
objectLevel = [ "c" ]

  [[topLevel.arrayOfObjs]]
  obj_a = "obj_a_val"
  obj_b = "obj_b_val"

json2toml returns the following instead

[[topLevel]]
arrayOfObjs = []
objectLevel = ["a","b"]
[[topLevel]]
[[arrayOfObjs]]
obj_a = "obj_a_val"
obj_b = "obj_b_val"
objectLevel = ["c"]
@kenany kenany added the bug label Jun 2, 2023
@yanu23
Copy link

yanu23 commented Feb 10, 2024

Are you fixing this?

@kenany
Copy link
Owner

kenany commented Feb 11, 2024

I tried during the bugs cleanup of v5 but if I recall correctly it wasn't a trivial fix. The tables implementation was contributed by mcaruso85 and probably needs a refactor to support cases like this one.

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

3 participants