@@ -52,6 +52,7 @@ func TestBodyTypeInit(t *testing.T) {
5252 {"result-explicit-body-user-type" , testdata .ExplicitBodyUserResultMultipleViewsDSL , 3 , ExplicitBodyUserResultMultipleViewsInitCode },
5353 {"result-explicit-body-object" , testdata .ExplicitBodyUserResultObjectDSL , 3 , ExplicitBodyObjectInitCode },
5454 {"result-explicit-body-object-views" , testdata .ExplicitBodyUserResultObjectMultipleViewDSL , 3 , ExplicitBodyObjectViewsInitCode },
55+ {"body-streaming-aliased-array" , testdata .StreamingAliasedArrayDSL , 4 , StreamingAliasedArrayBodyInitCode },
5556 }
5657 for _ , c := range cases {
5758 t .Run (c .Name , func (t * testing.T ) {
@@ -279,6 +280,21 @@ func NewMethodExplicitBodyUserResultObjectMultipleViewResulttypemultipleviewsOK(
279280 return v
280281}
281282`
283+
284+ const StreamingAliasedArrayBodyInitCode = `// NewStreamStreamingBody builds the HTTP request body from the payload of the
285+ // "Stream" endpoint of the "StreamingAliasedArray" service.
286+ func NewStreamStreamingBody(p *streamingaliasedarray.PayloadType) *StreamStreamingBody {
287+ body := &StreamStreamingBody{}
288+ if p.Values != nil {
289+ body.Values = make([]CustomIntStreamingBody, len(p.Values))
290+ for i, val := range p.Values {
291+ body.Values[i] = CustomIntStreamingBody(val)
292+ }
293+ }
294+ return body
295+ }
296+ `
297+
282298const MixedPayloadInBodyClientTypesFile = `// MethodARequestBody is the type of the "ServiceMixedPayloadInBody" service
283299// "MethodA" endpoint HTTP request body.
284300type MethodARequestBody struct {
0 commit comments