MCPcopy Create free account
hub / github.com/goadesign/goa / renderClientDecodeCode

Function renderClientDecodeCode

http/codegen/oneof_http_codegen_test.go:95–107  ·  view source on GitHub ↗

renderClientDecodeCode renders the client decode section for a single-service DSL and returns the generated code.

(t *testing.T, dsl func())

Source from the content-addressed store, hash-verified

93// renderClientDecodeCode renders the client decode section for a single-service
94// DSL and returns the generated code.
95func renderClientDecodeCode(t *testing.T, dsl func()) string {
96 t.Helper()
97
98 root := RunHTTPDSL(t, dsl)
99 services := CreateHTTPServices(root)
100 fs := ClientFiles("", services)
101 require.Len(t, fs, 2)
102
103 sections := fs[1].SectionTemplates
104 require.Greater(t, len(sections), 2)
105
106 return codegen.SectionCode(t, sections[2])
107}
108
109// oneOfResultSingleViewDSL defines a ResultType whose only view drops the OneOf
110// field. Client response code must therefore treat the transport body as the

Calls 4

SectionCodeFunction · 0.92
RunHTTPDSLFunction · 0.85
CreateHTTPServicesFunction · 0.85
ClientFilesFunction · 0.70

Tested by

no test coverage detected