clientResponseViewName returns the response view used by client code generation when the design fixes the response to a single view. An empty string means the client must keep the unprojected transport body because the server may render multiple views.
(e *expr.HTTPEndpointExpr, md *service.MethodData)
| 2814 | // string means the client must keep the unprojected transport body because the |
| 2815 | // server may render multiple views. |
| 2816 | func clientResponseViewName(e *expr.HTTPEndpointExpr, md *service.MethodData) string { |
| 2817 | if md == nil || md.ViewedResult == nil { |
| 2818 | return "" |
| 2819 | } |
| 2820 | if v, ok := e.MethodExpr.Result.Meta.Last(expr.ViewMetaKey); ok { |
| 2821 | return v |
| 2822 | } |
| 2823 | if len(md.ViewedResult.Views) == 1 { |
| 2824 | return md.ViewedResult.Views[0].Name |
| 2825 | } |
| 2826 | return "" |
| 2827 | } |
| 2828 | |
| 2829 | func buildHTTPUnionTypeData(u *expr.Union, scope *codegen.NameScope) *service.UnionTypeData { |
| 2830 | att := &expr.AttributeExpr{Type: u} |
no test coverage detected