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

Invalid JSON emission when merging objects #312

Open
herrhotzenplotz opened this issue Nov 12, 2024 · 0 comments
Open

Invalid JSON emission when merging objects #312

herrhotzenplotz opened this issue Nov 12, 2024 · 0 comments

Comments

@herrhotzenplotz
Copy link

herrhotzenplotz commented Nov 12, 2024

The following UCL snippet generates bad JSON when piped through ucl_tool --format json:

section_a { key_1 = "value_1"; }
section_a { key_2 = "value_2"; }
section_b { key_3 = "value_3"; }
section_b { key_4 = "value_4"; }

This produces:

{
    "section_a": [
        {
            "key_1": "value_1"
        },
        {
            "key_2": "value_2"
        }
    ],
    , # <-- extra comma here
    "section_b": [
        {
            "key_3": "value_3"
        },
        {
            "key_4": "value_4"
        }
    ]
}

I have tried various other combinations but this seems to be the minimal reproducer.

Environment:

$ git log --format=reference @ -n 1 | cat
5c58d0d (Merge pull request #306 from vstakhov/vstakhov-messagepack-fix-ext, 2024-04-25)

$ uname -a
FreeBSD <hostname> 14.1-RELEASE-p6 FreeBSD 14.1-RELEASE-p6 141-patcheroo-n267731-c47db24ae68 GENERIC-RACK amd64
$ 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant