We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12f4993 commit ddde6f1Copy full SHA for ddde6f1
1 file changed
pkg/codegen/templates/client-with-responses.tmpl
@@ -119,6 +119,12 @@ func (c *ClientWithResponses) {{$opid}}{{.Suffix}}WithResponse(ctx context.Conte
119
120
// Parse{{genResponseTypeName $opid | ucFirst}} parses an HTTP response from a {{$opid}}WithResponse call
121
func Parse{{genResponseTypeName $opid | ucFirst}}(rsp *http.Response) (*{{genResponseTypeName $opid}}, error) {
122
+ if strings.Contains(rsp.Header.Get("Content-Type"), "text/event-stream") {
123
+ return &{{genResponseTypeName $opid}}{
124
+ HTTPResponse: rsp,
125
+ }, nil
126
+ }
127
+
128
bodyBytes, err := io.ReadAll(rsp.Body)
129
defer func() { _ = rsp.Body.Close() }()
130
if err != nil {
0 commit comments