Support maps with object values
tkrajina opened this issue · 3 comments
tkrajina commented
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}"`
}
shackra commented
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?
tkrajina commented
@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.
tkrajina commented
Implemented in v0.1.0