easyjson icon indicating copy to clipboard operation
easyjson copied to clipboard

Inline struct fields are omitted in case of name collision

Open buoto opened this issue 8 years ago • 2 comments

Consider following code:

type Outer struct {
    Inner
    A int64       `json:"a"`
    B interface{} `json:"b"`
}

type Inner struct {
    A map[string]float64 `json:"innerA"`
    B string             `json:"innerB"`
}

Serializing Outer{} using encoding/json gives us {"innerA":null,"innerB":"","a":0,"b":null} (snippet), but if we try to do the same in easyjson fields of inner struct are supressed by fields of the outer struct.

buoto avatar Oct 14 '16 09:10 buoto

I have the same problem

zplzpl avatar Oct 17 '17 04:10 zplzpl

Was this issue fixed from a PR? I see that this issue was closed but has no reference to a fix.

edit: I misread the mention above my comment. It seems this is still an outstanding issue, my bad.

jbonzo avatar Apr 23 '20 22:04 jbonzo