mholt / json-to-go

Translates JSON into a Go type in your browser instantly (original)

Home Page:https://mholt.github.io/json-to-go/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nested arrays of base types are converted incorrectly

grische opened this issue · comments

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"``