You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// AsCreateStuffBla returns the union data inside the CreateStuff as a CreateStuffBla
func (t CreateStuff) AsCreateStuffBla() (CreateStuffBla, error) {
var body CreateStuffBla
err := json.Unmarshal(t.union, &body)
return body, err
}
// FromCreateStuffBla overwrites any union data inside the CreateStuff as the provided CreateStuffBla
func (t *CreateStuff) FromCreateStuffBla(v CreateStuffBla) error {
v.Which = "bla"
b, err := json.Marshal(v)
t.union = b
return err
}
// MergeCreateStuffBla performs a merge with any union data inside the CreateStuff, using the provided CreateStuffBla
func (t *CreateStuff) MergeCreateStuffBla(v CreateStuffBla) error {
v.Which = "bla"
b, err := json.Marshal(v)
if err != nil {
return err
}
merged, err := runtime.JSONMerge(t.union, b)
t.union = merged
return err
}
One of the errors:
'"bla"' (type string) cannot be represented by the type *WhichStuff
v.Which = "bla" (etc.) doesn't work because Which is of type *WhichStuff and not a string. In our case it's even a type within another package (i.e. using x-go-type).
Besides fixing this issue, I wonder if we could also make the generation of those From<Name> and As<Name> and Merge<Name> optional. We don't use them at all and don't plan to use them either.
This might be related to #1619 but I haven't fully verified it.
The text was updated successfully, but these errors were encountered:
generated code:
One of the errors:
v.Which = "bla"
(etc.) doesn't work because Which is of type*WhichStuff
and not a string. In our case it's even a type within another package (i.e. usingx-go-type
).Besides fixing this issue, I wonder if we could also make the generation of those
From<Name>
andAs<Name>
andMerge<Name>
optional. We don't use them at all and don't plan to use them either.This might be related to #1619 but I haven't fully verified it.
The text was updated successfully, but these errors were encountered: