Support upload/download progress handlers
It would be great if the axios and xhr handlers supported per-request upload/download progress handlers. This is supported in the official openapi-generator package via client-specifc options that can be passed through to each request.
I'm not sure what would be the easiest path to support these handlers in this project. Fetch, Node, and Angular don't support progress callbacks, so maybe the quickest path would be to follow openapi-generator and accept optional request overrides on each request. These could even be opt-in via CLI arguments.
E.g.,
myService.uploadFile(fileBlob, {
onUploadProgress: (progress) => {},
// ... other client-specific request options
})
+1
Some cases could be handled through providing a custom axios instance since onUploadProgress is a constructor option. https://github.com/ferdikoomen/openapi-typescript-codegen/issues/942
Although supporting this on a per-request basis via config propagation would be nice.
As a temporary workaround I'm using axios request interceptors.
This only works since axios is imported as a singleton in this package and this method patches the global axios instance.
axios.interceptors.request.use((config) => {
config.onUploadProgress = (progressEvent) => {}
return config
})
I've created a PR that can solve this by allowing an axios custom instance, #1434. Please comment there so it will get attention 😄
Check my PR #1682
any update ?
any update ?
Just use my PR #1682