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
See file attachment for API that demonstrates the issue. foo.zip
We have had to change from using Type to ResultType for media with multiple views since Type no longer allows views after goa v3.17
Changing to ResultType exposes a weird issue having to do with nesting and extending ResultType. when top-level media includes a field that has an extended ResultType then the deepest ResultType fails to codegen properly in "foo/gen/http/bar/client/encode_decode.go" and "foo/gen/http/bar/server/encode_decode.go". the bug is the same in both cases:
// marshalBarviewsImmediateChildExtenderViewToImmediateChildExtenderResponseBody
// builds a value of type *ImmediateChildExtenderResponseBody from a value of
// type *barviews.ImmediateChildExtenderView.
func marshalBarviewsImmediateChildExtenderViewToImmediateChildExtenderResponseBody(v *barviews.ImmediateChildExtenderView) *ImmediateChildExtenderResponseBody {
if v == nil {
return nil
}
res := &ImmediateChildExtenderResponseBody{
ID: *v.ID,
Name: *v.Name,
More: v.More,
}
if v.DeepChild != nil {
res.DeepChild = marshalBarviewsDeepChildToDeepChildResponseBody(v.DeepChild) <--- wrong function name, missing "View"
}
return res
}
// marshalBarviewsDeepChildViewToDeepChildResponseBody builds a value of type
// *DeepChildResponseBody from a value of type *barviews.DeepChildView.
func marshalBarviewsDeepChildViewToDeepChildResponseBody(v *barviews.DeepChildView) *DeepChildResponseBody {
if v == nil {
return nil
}
res := &DeepChildResponseBody{
ID: *v.ID,
Name: *v.Name,
}
return res
}
Note that this bug appears to have been present for many previous versions but is only seen when forced to change from using Type to ResultType. Not sure if having multiple views are required to reproduce but our use case has them.
Example of codegen:
~/gopath/src/foo$ goa version
Goa version v3.19.1
~/gopath/src/foo$ goa gen foo/design
gen/bar/client.go
...
The text was updated successfully, but these errors were encountered:
Hello Scott!! Sorry it took so long to get to this. I have a potential fix on this branch: fix/deep_user_type_extend_views (#3608). Are you able to test the fix?
See file attachment for API that demonstrates the issue.
foo.zip
We have had to change from using Type to ResultType for media with multiple views since Type no longer allows views after goa v3.17
Changing to ResultType exposes a weird issue having to do with nesting and extending ResultType. when top-level media includes a field that has an extended ResultType then the deepest ResultType fails to codegen properly in "foo/gen/http/bar/client/encode_decode.go" and "foo/gen/http/bar/server/encode_decode.go". the bug is the same in both cases:
Note that this bug appears to have been present for many previous versions but is only seen when forced to change from using Type to ResultType. Not sure if having multiple views are required to reproduce but our use case has them.
Example of codegen:
The text was updated successfully, but these errors were encountered: