struct2ts icon indicating copy to clipboard operation
struct2ts copied to clipboard

[]interface{} not converted to any[]

Open jfsiii opened this issue 4 years ago • 0 comments

From https://github.com/OneOfOne/struct2ts/issues/13#issuecomment-572788815

A struct with

Vars           []map[string]interface{} `config:"vars" json:"vars,omitempty"`

is converted to:

vars?: map[string]interface {}[];

instead of

vars?: { [key: string]: any }[];

but if we drop the array

Vars           map[string]interface{} `config:"vars" json:"vars,omitempty"`

it's converted to

vars?: { [key: string]: any };

jfsiii avatar Jan 10 '20 13:01 jfsiii