Open BatmanAoD opened 1 year ago
I would like to generate a Go struct where some of the fields are "embedded" in another struct:
type Inner struct { Foo string `json:"foo"` Bar string `json:"bar"` } type SharedType struct { Inner Baz string `json:"baz"` }
This is marshaled and unmarshaled as:
{ "foo": "<data>", "bar": "<data>", "baz": "<data>" }
Would it be feasible to add Go-specific medadata to enable codegen like this? Something like:
medadata
{ "properties": { "foo": { "metadata": { "goEmbedded": "Inner" }, "type": "string" }, "bar": { "metadata": { "goEmbedded": "Inner" }, "type": "string" }, "baz": { "type": "string" }, } }
I would like to generate a Go struct where some of the fields are "embedded" in another struct:
This is marshaled and unmarshaled as:
Would it be feasible to add Go-specific
medadata
to enable codegen like this? Something like: