From 30f1f3634ba1c5deb72c117c38820f8a24dafb0e Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sun, 11 Jan 2026 22:54:08 +0100 Subject: [PATCH 1/6] Update isomorphic-fetch file to allow for response streaming (#1) --- .../main/resources/typescript/http/http.mustache | 13 +++++++++++++ .../typescript/http/isomorphic-fetch.mustache | 3 ++- .../client/echo_api/typescript/build/http/http.ts | 5 +++++ .../typescript/build/http/isomorphic-fetch.ts | 3 ++- .../petstore/typescript/builds/browser/http/http.ts | 1 + .../petstore/typescript/builds/default/http/http.ts | 5 +++++ .../builds/default/http/isomorphic-fetch.ts | 3 ++- .../typescript/builds/inversify/http/http.ts | 5 +++++ .../builds/inversify/http/isomorphic-fetch.ts | 3 ++- .../typescript/builds/object_params/http/http.ts | 5 +++++ .../builds/object_params/http/isomorphic-fetch.ts | 3 ++- 11 files changed, 44 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript/http/http.mustache b/modules/openapi-generator/src/main/resources/typescript/http/http.mustache index 440022a3e668..12f3471ed7a5 100644 --- a/modules/openapi-generator/src/main/resources/typescript/http/http.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/http/http.mustache @@ -216,6 +216,11 @@ export class RequestContext { export interface ResponseBody { text(): Promise; binary(): Promise<{{{fileContentDataType}}}>; + {{#platforms}} + {{#node}} + stream(): ReadableStream | null; + {{/node}} + {{/platforms}} } /** @@ -253,6 +258,14 @@ export class SelfDecodingBody implements ResponseBody { {{/deno}} {{/platforms}} } + + {{#platforms}} + {{#node}} + stream(): ReadableStream | null { + return null; + } + {{/node}} + {{/platforms}} } export class ResponseContext { diff --git a/modules/openapi-generator/src/main/resources/typescript/http/isomorphic-fetch.mustache b/modules/openapi-generator/src/main/resources/typescript/http/isomorphic-fetch.mustache index a4f779b937c4..f9e38334e3e9 100644 --- a/modules/openapi-generator/src/main/resources/typescript/http/isomorphic-fetch.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/http/isomorphic-fetch.mustache @@ -38,7 +38,8 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { {{#node}} const body = { text: () => resp.text(), - binary: () => resp.buffer() + binary: () => resp.buffer(), + stream: () => resp.body }; {{/node}} {{^node}} diff --git a/samples/client/echo_api/typescript/build/http/http.ts b/samples/client/echo_api/typescript/build/http/http.ts index 68974f3164cf..9335bcc19de1 100644 --- a/samples/client/echo_api/typescript/build/http/http.ts +++ b/samples/client/echo_api/typescript/build/http/http.ts @@ -162,6 +162,7 @@ export class RequestContext { export interface ResponseBody { text(): Promise; binary(): Promise; + stream?(): ReadableStream | null; } /** @@ -178,6 +179,10 @@ export class SelfDecodingBody implements ResponseBody { const data: Buffer = await this.dataSource; return data.toString(); } + + stream(): ReadableStream | null { + return null; + } } export class ResponseContext { diff --git a/samples/client/echo_api/typescript/build/http/isomorphic-fetch.ts b/samples/client/echo_api/typescript/build/http/isomorphic-fetch.ts index 23cfa867b046..fd0627960b43 100644 --- a/samples/client/echo_api/typescript/build/http/isomorphic-fetch.ts +++ b/samples/client/echo_api/typescript/build/http/isomorphic-fetch.ts @@ -22,7 +22,8 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { const body = { text: () => resp.text(), - binary: () => resp.buffer() + binary: () => resp.buffer(), + stream: () => resp.body }; return new ResponseContext(resp.status, headers, body); }); diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/browser/http/http.ts index 6ac932c7c23a..3a83e7519fbe 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/http/http.ts @@ -174,6 +174,7 @@ export class SelfDecodingBody implements ResponseBody { reader.readAsText(data); }); } + } export class ResponseContext { diff --git a/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts index 68974f3164cf..79bdf44c9afe 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts @@ -162,6 +162,7 @@ export class RequestContext { export interface ResponseBody { text(): Promise; binary(): Promise; + stream(): ReadableStream | null; } /** @@ -178,6 +179,10 @@ export class SelfDecodingBody implements ResponseBody { const data: Buffer = await this.dataSource; return data.toString(); } + + stream(): ReadableStream | null { + return null; + } } export class ResponseContext { diff --git a/samples/openapi3/client/petstore/typescript/builds/default/http/isomorphic-fetch.ts b/samples/openapi3/client/petstore/typescript/builds/default/http/isomorphic-fetch.ts index 23cfa867b046..fd0627960b43 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/http/isomorphic-fetch.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/http/isomorphic-fetch.ts @@ -22,7 +22,8 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { const body = { text: () => resp.text(), - binary: () => resp.buffer() + binary: () => resp.buffer(), + stream: () => resp.body }; return new ResponseContext(resp.status, headers, body); }); diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts index 39da9e077230..7692f1b3c601 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts @@ -162,6 +162,7 @@ export class RequestContext { export interface ResponseBody { text(): Promise; binary(): Promise; + stream?(): ReadableStream | null; } /** @@ -178,6 +179,10 @@ export class SelfDecodingBody implements ResponseBody { const data: Buffer = await this.dataSource; return data.toString(); } + + stream(): ReadableStream | null { + return null; + } } export class ResponseContext { diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/http/isomorphic-fetch.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/http/isomorphic-fetch.ts index 23cfa867b046..fd0627960b43 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/http/isomorphic-fetch.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/http/isomorphic-fetch.ts @@ -22,7 +22,8 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { const body = { text: () => resp.text(), - binary: () => resp.buffer() + binary: () => resp.buffer(), + stream: () => resp.body }; return new ResponseContext(resp.status, headers, body); }); diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts index 68974f3164cf..9335bcc19de1 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts @@ -162,6 +162,7 @@ export class RequestContext { export interface ResponseBody { text(): Promise; binary(): Promise; + stream?(): ReadableStream | null; } /** @@ -178,6 +179,10 @@ export class SelfDecodingBody implements ResponseBody { const data: Buffer = await this.dataSource; return data.toString(); } + + stream(): ReadableStream | null { + return null; + } } export class ResponseContext { diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/http/isomorphic-fetch.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/http/isomorphic-fetch.ts index 23cfa867b046..fd0627960b43 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/http/isomorphic-fetch.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/http/isomorphic-fetch.ts @@ -22,7 +22,8 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { const body = { text: () => resp.text(), - binary: () => resp.buffer() + binary: () => resp.buffer(), + stream: () => resp.body }; return new ResponseContext(resp.status, headers, body); }); From a3295bcf40351e139c171ea56990bc5456d96a5b Mon Sep 17 00:00:00 2001 From: Charaf Rezrazi <2086576+Rezrazi@users.noreply.github.com> Date: Sun, 11 Jan 2026 23:02:48 +0100 Subject: [PATCH 2/6] Update samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../client/petstore/typescript/builds/inversify/http/http.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts index 7692f1b3c601..1626038a1bcf 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts @@ -162,7 +162,7 @@ export class RequestContext { export interface ResponseBody { text(): Promise; binary(): Promise; - stream?(): ReadableStream | null; + stream(): ReadableStream | null; } /** From 900aa45b51e06caa7641ae75fa54a979d5173eb5 Mon Sep 17 00:00:00 2001 From: Charaf Rezrazi <2086576+Rezrazi@users.noreply.github.com> Date: Sun, 11 Jan 2026 23:02:56 +0100 Subject: [PATCH 3/6] Update samples/client/echo_api/typescript/build/http/http.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- samples/client/echo_api/typescript/build/http/http.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/client/echo_api/typescript/build/http/http.ts b/samples/client/echo_api/typescript/build/http/http.ts index 9335bcc19de1..79bdf44c9afe 100644 --- a/samples/client/echo_api/typescript/build/http/http.ts +++ b/samples/client/echo_api/typescript/build/http/http.ts @@ -162,7 +162,7 @@ export class RequestContext { export interface ResponseBody { text(): Promise; binary(): Promise; - stream?(): ReadableStream | null; + stream(): ReadableStream | null; } /** From 7938a11e5a13836b9a183c0f454368cc84064aee Mon Sep 17 00:00:00 2001 From: Charaf Rezrazi <2086576+Rezrazi@users.noreply.github.com> Date: Sun, 11 Jan 2026 23:03:02 +0100 Subject: [PATCH 4/6] Update samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../petstore/typescript/builds/object_params/http/http.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts index 9335bcc19de1..79bdf44c9afe 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts @@ -162,7 +162,7 @@ export class RequestContext { export interface ResponseBody { text(): Promise; binary(): Promise; - stream?(): ReadableStream | null; + stream(): ReadableStream | null; } /** From 785873bccf15c04327a415072db0d4f706db7339 Mon Sep 17 00:00:00 2001 From: Charaf Rezrazi <2086576+Rezrazi@users.noreply.github.com> Date: Thu, 15 Jan 2026 19:04:42 +0100 Subject: [PATCH 5/6] update samples --- .../others/typescript/builds/array-of-lists/http/http.ts | 1 + .../others/typescript/builds/enum-single-value/http/http.ts | 1 + .../others/typescript/builds/null-types-simple/http/http.ts | 1 + .../others/typescript/builds/with-unique-items/http/http.ts | 1 + .../others/typescript/encode-decode/build/http/http.ts | 5 +++++ .../typescript/encode-decode/build/http/isomorphic-fetch.ts | 3 ++- .../petstore/typescript/builds/composed-schemas/http/http.ts | 1 + .../client/petstore/typescript/builds/deno/http/http.ts | 1 + .../typescript/builds/deno_object_params/http/http.ts | 1 + .../petstore/typescript/builds/explode-query/http/http.ts | 5 +++++ .../typescript/builds/explode-query/http/isomorphic-fetch.ts | 3 ++- .../client/petstore/typescript/builds/jquery/http/http.ts | 1 + .../petstore/typescript/builds/nullable-enum/http/http.ts | 1 + 13 files changed, 23 insertions(+), 2 deletions(-) diff --git a/samples/client/others/typescript/builds/array-of-lists/http/http.ts b/samples/client/others/typescript/builds/array-of-lists/http/http.ts index 6ac932c7c23a..3a83e7519fbe 100644 --- a/samples/client/others/typescript/builds/array-of-lists/http/http.ts +++ b/samples/client/others/typescript/builds/array-of-lists/http/http.ts @@ -174,6 +174,7 @@ export class SelfDecodingBody implements ResponseBody { reader.readAsText(data); }); } + } export class ResponseContext { diff --git a/samples/client/others/typescript/builds/enum-single-value/http/http.ts b/samples/client/others/typescript/builds/enum-single-value/http/http.ts index 6ac932c7c23a..3a83e7519fbe 100644 --- a/samples/client/others/typescript/builds/enum-single-value/http/http.ts +++ b/samples/client/others/typescript/builds/enum-single-value/http/http.ts @@ -174,6 +174,7 @@ export class SelfDecodingBody implements ResponseBody { reader.readAsText(data); }); } + } export class ResponseContext { diff --git a/samples/client/others/typescript/builds/null-types-simple/http/http.ts b/samples/client/others/typescript/builds/null-types-simple/http/http.ts index 6ac932c7c23a..3a83e7519fbe 100644 --- a/samples/client/others/typescript/builds/null-types-simple/http/http.ts +++ b/samples/client/others/typescript/builds/null-types-simple/http/http.ts @@ -174,6 +174,7 @@ export class SelfDecodingBody implements ResponseBody { reader.readAsText(data); }); } + } export class ResponseContext { diff --git a/samples/client/others/typescript/builds/with-unique-items/http/http.ts b/samples/client/others/typescript/builds/with-unique-items/http/http.ts index 6ac932c7c23a..3a83e7519fbe 100644 --- a/samples/client/others/typescript/builds/with-unique-items/http/http.ts +++ b/samples/client/others/typescript/builds/with-unique-items/http/http.ts @@ -174,6 +174,7 @@ export class SelfDecodingBody implements ResponseBody { reader.readAsText(data); }); } + } export class ResponseContext { diff --git a/samples/client/others/typescript/encode-decode/build/http/http.ts b/samples/client/others/typescript/encode-decode/build/http/http.ts index 68974f3164cf..79bdf44c9afe 100644 --- a/samples/client/others/typescript/encode-decode/build/http/http.ts +++ b/samples/client/others/typescript/encode-decode/build/http/http.ts @@ -162,6 +162,7 @@ export class RequestContext { export interface ResponseBody { text(): Promise; binary(): Promise; + stream(): ReadableStream | null; } /** @@ -178,6 +179,10 @@ export class SelfDecodingBody implements ResponseBody { const data: Buffer = await this.dataSource; return data.toString(); } + + stream(): ReadableStream | null { + return null; + } } export class ResponseContext { diff --git a/samples/client/others/typescript/encode-decode/build/http/isomorphic-fetch.ts b/samples/client/others/typescript/encode-decode/build/http/isomorphic-fetch.ts index 23cfa867b046..fd0627960b43 100644 --- a/samples/client/others/typescript/encode-decode/build/http/isomorphic-fetch.ts +++ b/samples/client/others/typescript/encode-decode/build/http/isomorphic-fetch.ts @@ -22,7 +22,8 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { const body = { text: () => resp.text(), - binary: () => resp.buffer() + binary: () => resp.buffer(), + stream: () => resp.body }; return new ResponseContext(resp.status, headers, body); }); diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/http/http.ts index 6ac932c7c23a..3a83e7519fbe 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/http/http.ts @@ -174,6 +174,7 @@ export class SelfDecodingBody implements ResponseBody { reader.readAsText(data); }); } + } export class ResponseContext { diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/deno/http/http.ts index c71b19bf2895..91bd0b2c2c37 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/http/http.ts @@ -162,6 +162,7 @@ export class SelfDecodingBody implements ResponseBody { const data: Blob = await this.dataSource; return data.text(); } + } export class ResponseContext { diff --git a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/http/http.ts index c71b19bf2895..91bd0b2c2c37 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno_object_params/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno_object_params/http/http.ts @@ -162,6 +162,7 @@ export class SelfDecodingBody implements ResponseBody { const data: Blob = await this.dataSource; return data.text(); } + } export class ResponseContext { diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/http/http.ts index 68974f3164cf..79bdf44c9afe 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/http/http.ts @@ -162,6 +162,7 @@ export class RequestContext { export interface ResponseBody { text(): Promise; binary(): Promise; + stream(): ReadableStream | null; } /** @@ -178,6 +179,10 @@ export class SelfDecodingBody implements ResponseBody { const data: Buffer = await this.dataSource; return data.toString(); } + + stream(): ReadableStream | null { + return null; + } } export class ResponseContext { diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/http/isomorphic-fetch.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/http/isomorphic-fetch.ts index 23cfa867b046..fd0627960b43 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/http/isomorphic-fetch.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/http/isomorphic-fetch.ts @@ -22,7 +22,8 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { const body = { text: () => resp.text(), - binary: () => resp.buffer() + binary: () => resp.buffer(), + stream: () => resp.body }; return new ResponseContext(resp.status, headers, body); }); diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts index db24c4927063..a4ca7586e06b 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts @@ -174,6 +174,7 @@ export class SelfDecodingBody implements ResponseBody { reader.readAsText(data); }); } + } export class ResponseContext { diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/http/http.ts index 6ac932c7c23a..3a83e7519fbe 100644 --- a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/http/http.ts +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/http/http.ts @@ -174,6 +174,7 @@ export class SelfDecodingBody implements ResponseBody { reader.readAsText(data); }); } + } export class ResponseContext { From 9125ee6ec500b71e9db0d95a19d090501f80f963 Mon Sep 17 00:00:00 2001 From: Charaf Rezrazi <2086576+Rezrazi@users.noreply.github.com> Date: Tue, 20 Jan 2026 11:09:46 +0100 Subject: [PATCH 6/6] fix tests --- .../client/others/typescript/encode-decode/test/test/server.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/client/others/typescript/encode-decode/test/test/server.ts b/samples/client/others/typescript/encode-decode/test/test/server.ts index a32330da9c19..a6747fc6cd08 100644 --- a/samples/client/others/typescript/encode-decode/test/test/server.ts +++ b/samples/client/others/typescript/encode-decode/test/test/server.ts @@ -26,6 +26,7 @@ class TestServerStub implements PromiseHttpLibrary { const body: ResponseBody = { binary: async () => { throw new Error('not implemented') }, text: async () => JSON.stringify(value), + stream: () => null, }; const headers = { 'content-type': 'application/json' }; return new ResponseContext(200, headers, body); @@ -35,6 +36,7 @@ class TestServerStub implements PromiseHttpLibrary { const body: ResponseBody = { binary: async () => { throw new Error('not implemented') }, text: async () => "", + stream: () => null, }; return new ResponseContext(200, {}, body); } else {