openapi-typescript-codegen icon indicating copy to clipboard operation
openapi-typescript-codegen copied to clipboard

Add custom axios config for request

Open 50Bytes-dev opened this issue 2 years ago • 4 comments

50Bytes-dev avatar Aug 07 '23 18:08 50Bytes-dev

Example usage:

FileService.uploadFile({
    file,
}).axiosConfig({
    onUploadProgress: (event) => {
        // Do something with the event
        console.log(event.loaded / event.total)
    }
})

50Bytes-dev avatar Aug 07 '23 19:08 50Bytes-dev

Can we get this merged? This opens up infinite possibilities.

brmdbr avatar Nov 29 '23 15:11 brmdbr

Bump, also very interested in this PR.

kkettinger avatar Feb 13 '24 18:02 kkettinger

To anyone still looking for this, check out our (previously forked) version of this package https://github.com/hey-api/openapi-ts. We have just recently added support for setting request/response interceptors. In the case of axios, this would allow you to modify the config used for each request before the request is sent. Please check it out if you'd like, and create any issues if you run into problems.

jordanshatford avatar Mar 27 '24 21:03 jordanshatford