mholt / json-to-go

Translates JSON into a Go type in your browser instantly (original)
https://mholt.github.io/json-to-go/
MIT License
4.48k stars 473 forks source link

Nested arrays of base types are converted incorrectly #139

Open grische opened 1 month ago

grische commented 1 month ago

This json

{
    "description": "this is an array of [][]int",
    "nested-array": [
        [
            0,
            1,
            2
        ],
        [
            2,
            3,
            4
        ]
    ]
}

is converted to

type AutoGenerated struct {
        Description string `json:"description"`
        NestedArray []NestedArray[]int `json:"nested-array"`
}

but it should be

type AutoGenerated struct {
        Description string `json:"description"`
        NestedArray [][]int `json:"nested-array"``