Api call 1
{
"thing": "val"
}
Api call 2
{
"something": "val"
}
type Foo struct {
Thing string
}
How would you handle getting "val"
into Thing
for both Api calls? In the one case, it's a deeply nested object, so I really really don't want to write my own unmarshalling.
I could just have 2 fields, Thing and Something, but that'll kinda suck. Not sure what good options there are, tho.
Have to agree with @erikh, except that I don't know why you would want to have two fields that go into one. I just represent objects as mirrors of their JSON equivalent.