-
-
Notifications
You must be signed in to change notification settings - Fork 573
Open
Description
With the release of Goa v3.22.1, I'm seeing it generate client code for server-to-client streaming methods that does not seem usable.
As a minimal example, I have this design.go
:
package design
import . "goa.design/goa/v3/dsl"
var _ = Service("goa-stream-issue", func() {
Method("Blah", func() {
StreamingResult(Int32)
HTTP(func() {
GET("/blah")
})
})
})
Running goa gen
on that results in a gen/goa_stream_issue/client.go
file with the following content:
// Code generated by goa v3.22.1, DO NOT EDIT.
//
// goa-stream-issue client
//
// Command:
// $ goa gen goa-stream-issue/design --output ..
package goastreamissue
import (
"context"
goa "goa.design/goa/v3/pkg"
)
// Client is the "goa-stream-issue" service client.
type Client struct {
BlahEndpoint goa.Endpoint
}
// NewClient initializes a "goa-stream-issue" service client given the
// endpoints.
func NewClient(blah goa.Endpoint) *Client {
return &Client{
BlahEndpoint: blah,
}
}
// Blah calls the "Blah" endpoint of the "goa-stream-issue" service.
func (c *Client) Blah(ctx context.Context) (err error) {
_, err = c.BlahEndpoint(ctx, nil)
return
}
Notice that Client.Blah()
return an error
only, discarding the result object it receives from BlahEndpoint()
. Hence there seems no way to use this client to get the streamed result items.
Compare this to Goa v3.21.5, where client.go
has:
// Blah calls the "Blah" endpoint of the "goa-stream-issue" service.
func (c *Client) Blah(ctx context.Context) (res BlahClientStream, err error) {
var ires any
ires, err = c.BlahEndpoint(ctx, nil)
if err != nil {
return
}
return ires.(BlahClientStream), nil
}
Am I missing something obvious here? I didn't see anything relevant in the release notes.
Metadata
Metadata
Assignees
Labels
No labels