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.51k stars 475 forks source link

Nested arrays of base types are converted incorrectly #139

Open grische opened 4 months ago

grische commented 4 months 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"``