tkrajina/typescriptify-golang-structs

Support maps with object values

tkrajina opened this issue · 3 comments

Field map[string]CustomStruct `json:"field"`

Should be converted to:

field: {[key: string]: CustomStruct};

At the moment, the way to convert maps is with custom types:

type Data struct {
    Counters map[string]int `json:"counters" ts_type:"{[key: string]: number}"`
}

Regarding this, you mentioned somewhere else that maybe you will merge https://github.com/tkrajina/typescriptify-golang-structs/tree/no-or-null any chance this may come true in the close future?

@shackra Yes, definitely. I just finished implementing maps now. I'll probably test it for a week or two and merge it it master then.

Implemented in v0.1.0