Skip to content

Commit 757882c

Browse files
committed
fix(code-gen): use response streams in TS axios Node.js client
1 parent f79df27 commit 757882c

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

packages/code-gen/src/api-client/ts-axios.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,14 @@ export function tsAxiosGenerateFunction(
346346
structureResolveReference(generateContext.structure, route.response)
347347
.type === "file"
348348
) {
349-
fileWrite(file, `responseType: "blob",`);
349+
if (
350+
generateContext.options.generators.apiClient?.target.targetRuntime ===
351+
"node.js"
352+
) {
353+
fileWrite(file, `responseType: "stream",`);
354+
} else {
355+
fileWrite(file, `responseType: "blob",`);
356+
}
350357
}
351358

352359
fileWrite(file, `...requestConfig,`);

0 commit comments

Comments
 (0)