-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Update isomorphic-fetch file to allow for response streaming (#1) #22673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds response streaming support to the TypeScript OpenAPI generator by introducing a new stream() method to the ResponseBody interface for Node.js platforms. The changes enable consumers to access the raw response stream, which is particularly useful for streaming responses from APIs like the Kubernetes client.
Changes:
- Added
stream()method toResponseBodyinterface andSelfDecodingBodyclass for Node.js platforms - Updated
isomorphic-fetch.tsto exposeresp.bodythrough the stream method - Regenerated samples across multiple TypeScript build configurations
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/openapi-generator/src/main/resources/typescript/http/isomorphic-fetch.mustache | Added stream property to response body object that returns resp.body |
| modules/openapi-generator/src/main/resources/typescript/http/http.mustache | Added stream() method to ResponseBody interface and SelfDecodingBody implementation for Node.js platforms |
| samples/openapi3/client/petstore/typescript/builds/object_params/http/isomorphic-fetch.ts | Generated: Added stream property to body object |
| samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts | Generated: Added stream method (incorrectly as optional) |
| samples/openapi3/client/petstore/typescript/builds/inversify/http/isomorphic-fetch.ts | Generated: Added stream property to body object |
| samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts | Generated: Added stream method (incorrectly as optional) |
| samples/openapi3/client/petstore/typescript/builds/default/http/isomorphic-fetch.ts | Generated: Added stream property to body object |
| samples/openapi3/client/petstore/typescript/builds/default/http/http.ts | Generated: Added stream method correctly as required |
| samples/openapi3/client/petstore/typescript/builds/browser/http/http.ts | Generated: Minor formatting change (added blank line) |
| samples/client/echo_api/typescript/build/http/isomorphic-fetch.ts | Generated: Added stream property to body object |
| samples/client/echo_api/typescript/build/http/http.ts | Generated: Added stream method (incorrectly as optional) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts
Outdated
Show resolved
Hide resolved
samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 11 files
…ttp/http.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ms/http/http.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)@joscha @mkusaka @davidgamero @amakhrov
Context:
Summary by cubic
Enable response streaming in Node-generated TypeScript clients by exposing resp.body and adding a stream() method on ResponseBody. This lets consumers read responses as streams without buffering.
Written for commit 7938a11. Summary will update on new commits.